<?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" /> <!-- qgraphicstransform.cpp --> <title>Qt 4.8: QGraphicsRotation Class Reference</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>QGraphicsRotation</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"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#properties">Properties</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QGraphicsRotation Class Reference</h1> <!-- $$$QGraphicsRotation-brief --> <p>The QGraphicsRotation class provides a rotation transformation around a given axis. <a href="#details">More...</a></p> <!-- @@@QGraphicsRotation --> <pre class="cpp"> <span class="preprocessor">#include <QGraphicsRotation></span></pre><p><b>Inherits: </b><a href="qgraphicstransform.html">QGraphicsTransform</a>.</p> <p>This class was introduced in Qt 4.6.</p> <ul> <li><a href="qgraphicsrotation-members.html">List of all members, including inherited members</a></li> </ul> <a name="properties"></a> <h2>Properties</h2> <ul> <li class="fn"><b><a href="qgraphicsrotation.html#angle-prop">angle</a></b> : qreal</li> <li class="fn"><b><a href="qgraphicsrotation.html#axis-prop">axis</a></b> : QVector3D</li> <li class="fn"><b><a href="qgraphicsrotation.html#origin-prop">origin</a></b> : QVector3D</li> </ul> <ul> <li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li> </ul> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#QGraphicsRotation">QGraphicsRotation</a></b> ( QObject * <i>parent</i> = 0 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#dtor.QGraphicsRotation">~QGraphicsRotation</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#angle-prop">angle</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVector3D </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#axis-prop">axis</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QVector3D </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#origin-prop">origin</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#angle-prop">setAngle</a></b> ( qreal )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#axis-prop">setAxis</a></b> ( const QVector3D & <i>axis</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#axis-prop">setAxis</a></b> ( Qt::Axis <i>axis</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#origin-prop">setOrigin</a></b> ( const QVector3D & <i>point</i> )</td></tr> </table> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#applyTo">applyTo</a></b> ( QMatrix4x4 * <i>matrix</i> ) const</td></tr> </table> <ul> <li class="fn">1 public function inherited from <a href="qgraphicstransform.html#public-functions">QGraphicsTransform</a></li> <li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> </ul> <a name="signals"></a> <h2>Signals</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#angleChanged">angleChanged</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#axisChanged">axisChanged</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qgraphicsrotation.html#originChanged">originChanged</a></b> ()</td></tr> </table> <ul> <li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li class="fn">1 protected slot inherited from <a href="qgraphicstransform.html#protected-slots">QGraphicsTransform</a></li> </ul> <a name="details"></a> <!-- $$$QGraphicsRotation-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QGraphicsRotation class provides a rotation transformation around a given axis.</p> <p>You can provide the desired axis by assigning a <a href="qvector3d.html">QVector3D</a> to the axis property or by passing a member if <a href="qt.html#Axis-enum">Qt::Axis</a> to the setAxis convenience function. By default the axis is (0, 0, 1) i.e., rotation around the Z axis.</p> <p>The angle property, which is provided by QGraphicsRotation, now describes the number of degrees to rotate around this axis.</p> <p>QGraphicsRotation provides certain parameters to help control how the rotation should be applied.</p> <p>The origin is the point that the item is rotated around (i.e., it stays fixed relative to the parent as the rest of the item is rotated). By default the origin is <a href="qpointf.html">QPointF</a>(0, 0).</p> <p>The angle property provides the number of degrees to rotate the item clockwise around the origin. This value also be negative, indicating a counter-clockwise rotation. For animation purposes it may also be useful to provide rotation angles exceeding (-360, 360) degrees, for instance to animate how an item rotates several times.</p> <p>Note: the final rotation is the combined effect of a rotation in 3D space followed by a projection back to 2D. If several rotations are performed in succession, they will not behave as expected unless they were all around the Z axis.</p> </div> <p><b>See also </b><a href="qgraphicstransform.html">QGraphicsTransform</a>, <a href="qgraphicsitem.html#setRotation">QGraphicsItem::setRotation</a>(), and <a href="qtransform.html#rotate">QTransform::rotate</a>().</p> <!-- @@@QGraphicsRotation --> <div class="prop"> <h2>Property Documentation</h2> <!-- $$$angle-prop$$$angle$$$setAngleqreal$$$angleChanged --> <h3 class="fn"><a name="angle-prop"></a><span class="name">angle</span> : <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3> <p>This property holds the angle for clockwise rotation, in degrees.</p> <p>The angle can be any real number; the default value is 0.0. A value of 180 will rotate 180 degrees, clockwise. If you provide a negative number, the item will be rotated counter-clockwise. Normally the rotation angle will be in the range (-360, 360), but you can also provide numbers outside of this range (e.g., a angle of 370 degrees gives the same result as 10 degrees). Setting the angle to NaN results in no rotation.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>angle</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAngle</b></span> ( qreal )</td></tr> </table> <p><b>Notifier signal:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicsrotation.html#angleChanged">angleChanged</a></b></span> ()</td></tr> </table> <p><b>See also </b><a href="qgraphicsrotation.html#origin-prop">origin</a>.</p> <!-- @@@angle --> <!-- $$$axis-prop$$$axis$$$setAxisconstQVector3D&$$$setAxisQt::Axis$$$axisChanged --> <h3 class="fn"><a name="axis-prop"></a><span class="name">axis</span> : <span class="type"><a href="qvector3d.html">QVector3D</a></span></h3> <p>This property holds a rotation axis, specified by a vector in 3D space.</p> <p>This can be any axis in 3D space. By default the axis is (0, 0, 1), which is aligned with the Z axis. If you provide another axis, <a href="qgraphicsrotation.html">QGraphicsRotation</a> will provide a transformation that rotates around this axis. For example, if you would like to rotate an item around its X axis, you could pass (1, 0, 0) as the axis.</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QVector3D </td><td class="memItemRight bottomAlign"><span class="name"><b>axis</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAxis</b></span> ( const QVector3D & <i>axis</i> )</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAxis</b></span> ( Qt::Axis <i>axis</i> )</td></tr> </table> <p><b>Notifier signal:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicsrotation.html#axisChanged">axisChanged</a></b></span> ()</td></tr> </table> <p><b>See also </b><a href="qtransform.html">QTransform</a> and <a href="qgraphicsrotation.html#angle-prop">QGraphicsRotation::angle</a>.</p> <!-- @@@axis --> <!-- $$$origin-prop$$$origin$$$setOriginconstQVector3D&$$$originChanged --> <h3 class="fn"><a name="origin-prop"></a><span class="name">origin</span> : <span class="type"><a href="qvector3d.html">QVector3D</a></span></h3> <p>This property holds the origin of the rotation in 3D space.</p> <p>All rotations will be done relative to this point (i.e., this point will stay fixed, relative to the parent, when the item is rotated).</p> <p><b>Access functions:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> QVector3D </td><td class="memItemRight bottomAlign"><span class="name"><b>origin</b></span> () const</td></tr> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOrigin</b></span> ( const QVector3D & <i>point</i> )</td></tr> </table> <p><b>Notifier signal:</b></p> <table class="alignedsummary"> <tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qgraphicsrotation.html#originChanged">originChanged</a></b></span> ()</td></tr> </table> <p><b>See also </b><a href="qgraphicsrotation.html#angle-prop">angle</a>.</p> <!-- @@@origin --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QGraphicsRotation[overload1]$$$QGraphicsRotationQObject* --> <h3 class="fn"><a name="QGraphicsRotation"></a>QGraphicsRotation::<span class="name">QGraphicsRotation</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3> <p>Constructs a new <a href="qgraphicsrotation.html">QGraphicsRotation</a> with the given <i>parent</i>.</p> <!-- @@@QGraphicsRotation --> <!-- $$$~QGraphicsRotation[overload1]$$$~QGraphicsRotation --> <h3 class="fn"><a name="dtor.QGraphicsRotation"></a>QGraphicsRotation::<span class="name">~QGraphicsRotation</span> ()</h3> <p>Destroys the graphics rotation.</p> <!-- @@@~QGraphicsRotation --> <!-- $$$angleChanged[overload1]$$$angleChanged --> <h3 class="fn"><a name="angleChanged"></a><span class="type">void</span> QGraphicsRotation::<span class="name">angleChanged</span> ()<tt> [signal]</tt></h3> <p>This signal is emitted whenever the angle has changed.</p> <p><b>See also </b><a href="qgraphicsrotation.html#angle-prop">QGraphicsRotation::angle</a>.</p> <!-- @@@angleChanged --> <!-- $$$applyTo[overload1]$$$applyToQMatrix4x4* --> <h3 class="fn"><a name="applyTo"></a><span class="type">void</span> QGraphicsRotation::<span class="name">applyTo</span> ( <span class="type"><a href="qmatrix4x4.html">QMatrix4x4</a></span> * <i>matrix</i> ) const<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qgraphicstransform.html#applyTo">QGraphicsTransform::applyTo</a>().</p> <!-- @@@applyTo --> <!-- $$$axisChanged[overload1]$$$axisChanged --> <h3 class="fn"><a name="axisChanged"></a><span class="type">void</span> QGraphicsRotation::<span class="name">axisChanged</span> ()<tt> [signal]</tt></h3> <p>This signal is emitted whenever the axis of the object changes.</p> <p><b>See also </b><a href="qgraphicsrotation.html#axis-prop">QGraphicsRotation::axis</a>.</p> <!-- @@@axisChanged --> <!-- $$$originChanged[overload1]$$$originChanged --> <h3 class="fn"><a name="originChanged"></a><span class="type">void</span> QGraphicsRotation::<span class="name">originChanged</span> ()<tt> [signal]</tt></h3> <p>This signal is emitted whenever the origin has changed.</p> <p><b>See also </b><a href="qgraphicsrotation.html#origin-prop">QGraphicsRotation::origin</a>.</p> <!-- @@@originChanged --> </div> </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>