<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qpainter.cpp --> <title>Qt 4.8: Obsolete Members for QPainter</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtgui.html">QtGui</a></li> <li>QPainter</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <h1 class="title">Obsolete Members for QPainter</h1> <p><b>The following class members are obsolete.</b> They are provided to keep old source code working. We strongly advise against using them in new code.</p> <p><ul><li><a href="qpainter.html">QPainter class reference</a></li></ul></p> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QMatrix </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#combinedMatrix">combinedMatrix</a></b> () const<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> const QMatrix & </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#deviceMatrix">deviceMatrix</a></b> () const<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#drawRoundRect">drawRoundRect</a></b> ( const QRectF & <i>r</i>, int <i>xRnd</i> = 25, int <i>yRnd</i> = 25 )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#drawRoundRect-2">drawRoundRect</a></b> ( const QRect & <i>r</i>, int <i>xRnd</i> = 25, int <i>yRnd</i> = 25 )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#drawRoundRect-3">drawRoundRect</a></b> ( int <i>x</i>, int <i>y</i>, int <i>w</i>, int <i>h</i>, int <i>xRnd</i> = 25, int <i>yRnd</i> = 25 )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> const QMatrix & </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#matrix">matrix</a></b> () const<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#matrixEnabled">matrixEnabled</a></b> () const<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#resetMatrix">resetMatrix</a></b> ()<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#setMatrix">setMatrix</a></b> ( const QMatrix & <i>matrix</i>, bool <i>combine</i> = false )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#setMatrixEnabled">setMatrixEnabled</a></b> ( bool <i>enable</i> )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#setWorldMatrix">setWorldMatrix</a></b> ( const QMatrix & <i>matrix</i>, bool <i>combine</i> = false )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> const QMatrix & </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#worldMatrix">worldMatrix</a></b> () const<tt> (obsolete)</tt></td></tr> </table> <h2>Static Public Members</h2> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QPaintDevice * </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#redirected">redirected</a></b> ( const QPaintDevice * <i>device</i>, QPoint * <i>offset</i> = 0 )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#restoreRedirected">restoreRedirected</a></b> ( const QPaintDevice * <i>device</i> )<tt> (obsolete)</tt></td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpainter-obsolete.html#setRedirected">setRedirected</a></b> ( const QPaintDevice * <i>device</i>, QPaintDevice * <i>replacement</i>, const QPoint & <i>offset</i> = QPoint() )<tt> (obsolete)</tt></td></tr> </table> <h2>Member Function Documentation</h2> <!-- $$$combinedMatrix[overload1]$$$combinedMatrix --> <h3 class="fn"><a name="combinedMatrix"></a><span class="type"><a href="qmatrix.html">QMatrix</a></span> QPainter::<span class="name">combinedMatrix</span> () const</h3> <p>Returns the transformation matrix combining the current window/viewport and world transformation.</p> <p>It is advisable to use <a href="qpainter.html#combinedTransform">combinedTransform</a>() instead of this function to preserve the properties of perspective transformations.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also </b><a href="qpainter.html#setWorldTransform">setWorldTransform</a>(), <a href="qpainter.html#setWindow">setWindow</a>(), and <a href="qpainter.html#setViewport">setViewport</a>().</p> <!-- @@@combinedMatrix --> <!-- $$$deviceMatrix[overload1]$$$deviceMatrix --> <h3 class="fn"><a name="deviceMatrix"></a>const <span class="type"><a href="qmatrix.html">QMatrix</a></span> & QPainter::<span class="name">deviceMatrix</span> () const</h3> <p>Returns the matrix that transforms from logical coordinates to device coordinates of the platform dependent paint device.</p> <p><b>Note:</b> It is advisable to use <a href="qpainter.html#deviceTransform">deviceTransform</a>() instead of this function to preserve the properties of perspective transformations.</p> <p>This function is <i>only</i> needed when using platform painting commands on the platform dependent handle (<a href="qt.html#HANDLE-typedef">Qt::HANDLE</a>), and the platform does not do transformations nativly.</p> <p>The <a href="qpaintengine.html#PaintEngineFeature-enum">QPaintEngine::PaintEngineFeature</a> enum can be queried to determine whether the platform performs the transformations or not.</p> <p><b>See also </b><a href="qpainter-obsolete.html#worldMatrix">worldMatrix</a>() and <a href="qpaintengine.html#hasFeature">QPaintEngine::hasFeature</a>().</p> <!-- @@@deviceMatrix --> <!-- $$$drawRoundRect[overload1]$$$drawRoundRectconstQRectF&intint --> <h3 class="fn"><a name="drawRoundRect"></a><span class="type">void</span> QPainter::<span class="name">drawRoundRect</span> ( const <span class="type"><a href="qrectf.html">QRectF</a></span> & <i>r</i>, <span class="type">int</span> <i>xRnd</i> = 25, <span class="type">int</span> <i>yRnd</i> = 25 )</h3> <p>Draws a rectangle <i>r</i> with rounded corners.</p> <p>The <i>xRnd</i> and <i>yRnd</i> arguments specify how rounded the corners should be. 0 is angled corners, 99 is maximum roundedness.</p> <p>A filled rectangle has a size of r.size(). A stroked rectangle has a size of r.size() plus the pen width.</p> <p><b>See also </b><a href="qpainter.html#drawRoundedRect">drawRoundedRect</a>().</p> <!-- @@@drawRoundRect --> <!-- $$$drawRoundRect$$$drawRoundRectconstQRect&intint --> <h3 class="fn"><a name="drawRoundRect-2"></a><span class="type">void</span> QPainter::<span class="name">drawRoundRect</span> ( const <span class="type"><a href="qrect.html">QRect</a></span> & <i>r</i>, <span class="type">int</span> <i>xRnd</i> = 25, <span class="type">int</span> <i>yRnd</i> = 25 )</h3> <p>This is an overloaded function.</p> <p>Draws the rectangle <i>r</i> with rounded corners.</p> <!-- @@@drawRoundRect --> <!-- $$$drawRoundRect$$$drawRoundRectintintintintintint --> <h3 class="fn"><a name="drawRoundRect-3"></a><span class="type">void</span> QPainter::<span class="name">drawRoundRect</span> ( <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>w</i>, <span class="type">int</span> <i>h</i>, <span class="type">int</span> <i>xRnd</i> = 25, <span class="type">int</span> <i>yRnd</i> = 25 )</h3> <p>This is an overloaded function.</p> <p>Draws the rectangle <i>x</i>, <i>y</i>, <i>w</i>, <i>h</i> with rounded corners.</p> <!-- @@@drawRoundRect --> <!-- $$$matrix[overload1]$$$matrix --> <h3 class="fn"><a name="matrix"></a>const <span class="type"><a href="qmatrix.html">QMatrix</a></span> & QPainter::<span class="name">matrix</span> () const</h3> <p>Use <a href="qpainter.html#worldTransform">worldTransform</a>() instead.</p> <p><b>See also </b><a href="qpainter-obsolete.html#setMatrix">setMatrix</a>() and <a href="qpainter.html#worldTransform">worldTransform</a>().</p> <!-- @@@matrix --> <!-- $$$matrixEnabled[overload1]$$$matrixEnabled --> <h3 class="fn"><a name="matrixEnabled"></a><span class="type">bool</span> QPainter::<span class="name">matrixEnabled</span> () const</h3> <p>Use <a href="qpainter.html#worldMatrixEnabled">worldMatrixEnabled</a>() instead</p> <p><b>See also </b><a href="qpainter-obsolete.html#setMatrixEnabled">setMatrixEnabled</a>() and <a href="qpainter.html#worldMatrixEnabled">worldMatrixEnabled</a>().</p> <!-- @@@matrixEnabled --> <!-- $$$redirected[overload1]$$$redirectedconstQPaintDevice*QPoint* --> <h3 class="fn"><a name="redirected"></a><span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * QPainter::<span class="name">redirected</span> ( const <span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * <i>device</i>, <span class="type"><a href="qpoint.html">QPoint</a></span> * <i>offset</i> = 0 )<tt> [static]</tt></h3> <p>Using <a href="qwidget.html#render">QWidget::render</a>() obsoletes the use of this function.</p> <p>Returns the replacement for given <i>device</i>. The optional out parameter <i>offset</i> returns the offset within the replaced device.</p> <p><b>Warning:</b> Making use of redirections in the <a href="qpainter.html">QPainter</a> API implies that <a href="qpainter.html#begin">QPainter::begin</a>() and <a href="qpaintdevice.html">QPaintDevice</a> destructors need to hold a mutex for a short period. This can impact performance. Use of QWidget::render is strongly encouraged.</p> <p><b>Note:</b> This function is <a href="threads-reentrancy.html#thread-safe">thread-safe</a>.</p> <p><b>See also </b><a href="qpainter-obsolete.html#setRedirected">setRedirected</a>() and <a href="qpainter-obsolete.html#restoreRedirected">restoreRedirected</a>().</p> <!-- @@@redirected --> <!-- $$$resetMatrix[overload1]$$$resetMatrix --> <h3 class="fn"><a name="resetMatrix"></a><span class="type">void</span> QPainter::<span class="name">resetMatrix</span> ()</h3> <p>Resets any transformations that were made using <a href="qpainter.html#translate">translate</a>(), <a href="qpainter.html#scale">scale</a>(), <a href="qpainter.html#shear">shear</a>(), <a href="qpainter.html#rotate">rotate</a>(), <a href="qpainter-obsolete.html#setWorldMatrix">setWorldMatrix</a>(), <a href="qpainter.html#setViewport">setViewport</a>() and <a href="qpainter.html#setWindow">setWindow</a>().</p> <p>It is advisable to use <a href="qpainter.html#resetTransform">resetTransform</a>() instead of this function to preserve the properties of perspective transformations.</p> <p><b>See also </b><a href="qpainter.html#coordinate-transformations">Coordinate Transformations</a>.</p> <!-- @@@resetMatrix --> <!-- $$$restoreRedirected[overload1]$$$restoreRedirectedconstQPaintDevice* --> <h3 class="fn"><a name="restoreRedirected"></a><span class="type">void</span> QPainter::<span class="name">restoreRedirected</span> ( const <span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * <i>device</i> )<tt> [static]</tt></h3> <p>Using <a href="qwidget.html#render">QWidget::render</a>() obsoletes the use of this function.</p> <p>Restores the previous redirection for the given <i>device</i> after a call to <a href="qpainter-obsolete.html#setRedirected">setRedirected</a>().</p> <p><b>Warning:</b> Making use of redirections in the <a href="qpainter.html">QPainter</a> API implies that <a href="qpainter.html#begin">QPainter::begin</a>() and <a href="qpaintdevice.html">QPaintDevice</a> destructors need to hold a mutex for a short period. This can impact performance. Use of QWidget::render is strongly encouraged.</p> <p><b>Note:</b> This function is <a href="threads-reentrancy.html#thread-safe">thread-safe</a>.</p> <p><b>See also </b><a href="qpainter-obsolete.html#redirected">redirected</a>().</p> <!-- @@@restoreRedirected --> <!-- $$$setMatrix[overload1]$$$setMatrixconstQMatrix&bool --> <h3 class="fn"><a name="setMatrix"></a><span class="type">void</span> QPainter::<span class="name">setMatrix</span> ( const <span class="type"><a href="qmatrix.html">QMatrix</a></span> & <i>matrix</i>, <span class="type">bool</span> <i>combine</i> = false )</h3> <p>Use <a href="qpainter.html#setWorldTransform">setWorldTransform</a>() instead.</p> <p><b>See also </b><a href="qpainter-obsolete.html#matrix">matrix</a>() and <a href="qpainter.html#setWorldTransform">setWorldTransform</a>().</p> <!-- @@@setMatrix --> <!-- $$$setMatrixEnabled[overload1]$$$setMatrixEnabledbool --> <h3 class="fn"><a name="setMatrixEnabled"></a><span class="type">void</span> QPainter::<span class="name">setMatrixEnabled</span> ( <span class="type">bool</span> <i>enable</i> )</h3> <p>Use <a href="qpainter.html#setWorldMatrixEnabled">setWorldMatrixEnabled</a>() instead.</p> <p><b>See also </b><a href="qpainter-obsolete.html#matrixEnabled">matrixEnabled</a>() and <a href="qpainter.html#setWorldMatrixEnabled">setWorldMatrixEnabled</a>().</p> <!-- @@@setMatrixEnabled --> <!-- $$$setRedirected[overload1]$$$setRedirectedconstQPaintDevice*QPaintDevice*constQPoint& --> <h3 class="fn"><a name="setRedirected"></a><span class="type">void</span> QPainter::<span class="name">setRedirected</span> ( const <span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * <i>device</i>, <span class="type"><a href="qpaintdevice.html">QPaintDevice</a></span> * <i>replacement</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> & <i>offset</i> = QPoint() )<tt> [static]</tt></h3> <p>Please use <a href="qwidget.html#render">QWidget::render</a>() instead.</p> <p>Redirects all paint commands for the given paint <i>device</i>, to the <i>replacement</i> device. The optional point <i>offset</i> defines an offset within the source device.</p> <p>The redirection will not be effective until the <a href="qpainter.html#begin">begin</a>() function has been called; make sure to call <a href="qpainter.html#end">end</a>() for the given <i>device</i>'s painter (if any) before redirecting. Call <a href="qpainter-obsolete.html#restoreRedirected">restoreRedirected</a>() to restore the previous redirection.</p> <p><b>Warning:</b> Making use of redirections in the <a href="qpainter.html">QPainter</a> API implies that <a href="qpainter.html#begin">QPainter::begin</a>() and <a href="qpaintdevice.html">QPaintDevice</a> destructors need to hold a mutex for a short period. This can impact performance. Use of QWidget::render is strongly encouraged.</p> <p><b>Note:</b> This function is <a href="threads-reentrancy.html#thread-safe">thread-safe</a>.</p> <p><b>See also </b><a href="qpainter-obsolete.html#redirected">redirected</a>() and <a href="qpainter-obsolete.html#restoreRedirected">restoreRedirected</a>().</p> <!-- @@@setRedirected --> <!-- $$$setWorldMatrix[overload1]$$$setWorldMatrixconstQMatrix&bool --> <h3 class="fn"><a name="setWorldMatrix"></a><span class="type">void</span> QPainter::<span class="name">setWorldMatrix</span> ( const <span class="type"><a href="qmatrix.html">QMatrix</a></span> & <i>matrix</i>, <span class="type">bool</span> <i>combine</i> = false )</h3> <p>Sets the transformation matrix to <i>matrix</i> and enables transformations.</p> <p><b>Note:</b> It is advisable to use <a href="qpainter.html#setWorldTransform">setWorldTransform</a>() instead of this function to preserve the properties of perspective transformations.</p> <p>If <i>combine</i> is true, then <i>matrix</i> is combined with the current transformation matrix; otherwise <i>matrix</i> replaces the current transformation matrix.</p> <p>If <i>matrix</i> is the identity matrix and <i>combine</i> is false, this function calls setWorldMatrixEnabled(false). (The identity matrix is the matrix where <a href="qmatrix.html#m11">QMatrix::m11</a>() and <a href="qmatrix.html#m22">QMatrix::m22</a>() are 1.0 and the rest are 0.0.)</p> <p>The following functions can transform the coordinate system without using a <a href="qmatrix.html">QMatrix</a>:</p> <ul> <li><a href="qpainter.html#translate">translate</a>()</li> <li><a href="qpainter.html#scale">scale</a>()</li> <li><a href="qpainter.html#shear">shear</a>()</li> <li><a href="qpainter.html#rotate">rotate</a>()</li> </ul> <p>They operate on the painter's <a href="qpainter-obsolete.html#worldMatrix">worldMatrix</a>() and are implemented like this:</p> <pre class="cpp"> <span class="type">void</span> <span class="type"><a href="qpainter.html">QPainter</a></span><span class="operator">::</span><a href="qpainter.html#rotate">rotate</a>(<span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> angle) { <span class="type"><a href="qmatrix.html">QMatrix</a></span> matrix; matrix<span class="operator">.</span>rotate(angle); setWorldMatrix(matrix<span class="operator">,</span> <span class="keyword">true</span>); }</pre> <p>Note that when using setWorldMatrix() function you should always have <i>combine</i> be true when you are drawing into a <a href="qpicture.html">QPicture</a>. Otherwise it may not be possible to replay the picture with additional transformations; using the <a href="qpainter.html#translate">translate</a>(), <a href="qpainter.html#scale">scale</a>(), etc. convenience functions is safe.</p> <p>For more information about the coordinate system, transformations and window-viewport conversion, see <a href="coordsys.html">Coordinate System</a>.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also </b><a href="qpainter-obsolete.html#worldMatrix">worldMatrix</a>(), <a href="qpainter.html#setWorldTransform">setWorldTransform</a>(), and <a href="qtransform.html">QTransform</a>.</p> <!-- @@@setWorldMatrix --> <!-- $$$worldMatrix[overload1]$$$worldMatrix --> <h3 class="fn"><a name="worldMatrix"></a>const <span class="type"><a href="qmatrix.html">QMatrix</a></span> & QPainter::<span class="name">worldMatrix</span> () const</h3> <p>Returns the world transformation matrix.</p> <p>It is advisable to use <a href="qpainter.html#worldTransform">worldTransform</a>() because worldMatrix() does not preserve the properties of perspective transformations.</p> <p>This function was introduced in Qt 4.2.</p> <p><b>See also </b><a href="qpainter-obsolete.html#setWorldMatrix">setWorldMatrix</a>(), <a href="qpainter.html#coordinate-transformations">Coordinate Transformations</a>, and <a href="coordsys.html">Coordinate System</a>.</p> <!-- @@@worldMatrix --> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>