Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1186

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QGraphicsItemAnimation Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QGraphicsItemAnimation Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QGraphicsItemAnimation class provides simple animation support for <a href="qgraphicsitem.html">QGraphicsItem</a>. <a href="#details">More...</a></p>
<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#QGraphicsItemAnimation">__init__</a></b> (<i>self</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#afterAnimationStep">afterAnimationStep</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#beforeAnimationStep">beforeAnimationStep</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#horizontalScaleAt">horizontalScaleAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#horizontalShearAt">horizontalShearAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />QGraphicsItem <b><a href="qgraphicsitemanimation.html#item">item</a></b> (<i>self</i>)</li><li><div class="fn" />QMatrix <b><a href="qgraphicsitemanimation.html#matrixAt">matrixAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />QPointF <b><a href="qgraphicsitemanimation.html#posAt">posAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />list-of-tuple-of-float-QPointF <b><a href="qgraphicsitemanimation.html#posList">posList</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#reset">reset</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#rotationAt">rotationAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />list-of-tuple-of-float-float <b><a href="qgraphicsitemanimation.html#rotationList">rotationList</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-tuple-of-float-QPointF <b><a href="qgraphicsitemanimation.html#scaleList">scaleList</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setItem">setItem</a></b> (<i>self</i>, QGraphicsItem)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setPosAt">setPosAt</a></b> (<i>self</i>, float, QPointF)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setRotationAt">setRotationAt</a></b> (<i>self</i>, float, float)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setScaleAt">setScaleAt</a></b> (<i>self</i>, float, float, float)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setShearAt">setShearAt</a></b> (<i>self</i>, float, float, float)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setStep">setStep</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setTimeLine">setTimeLine</a></b> (<i>self</i>, QTimeLine)</li><li><div class="fn" /><b><a href="qgraphicsitemanimation.html#setTranslationAt">setTranslationAt</a></b> (<i>self</i>, float, float, float)</li><li><div class="fn" />list-of-tuple-of-float-QPointF <b><a href="qgraphicsitemanimation.html#shearList">shearList</a></b> (<i>self</i>)</li><li><div class="fn" />QTimeLine <b><a href="qgraphicsitemanimation.html#timeLine">timeLine</a></b> (<i>self</i>)</li><li><div class="fn" />list-of-tuple-of-float-QPointF <b><a href="qgraphicsitemanimation.html#translationList">translationList</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#verticalScaleAt">verticalScaleAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#verticalShearAt">verticalShearAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#xTranslationAt">xTranslationAt</a></b> (<i>self</i>, float)</li><li><div class="fn" />float <b><a href="qgraphicsitemanimation.html#yTranslationAt">yTranslationAt</a></b> (<i>self</i>, float)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QGraphicsItemAnimation class provides simple animation support for <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>The QGraphicsItemAnimation class animates a <a href="qgraphicsitem.html">QGraphicsItem</a>. You can schedule changes to the item's transformation matrix at specified steps. The QGraphicsItemAnimation class has a current step value. When this value changes the transformations scheduled at that step are performed. The current step of the animation is set with the <tt>setStep()</tt> function.</p>
<p>QGraphicsItemAnimation will do a simple linear interpolation between the nearest adjacent scheduled changes to calculate the matrix. For instance, if you set the position of an item at values 0.0 and 1.0, the animation will show the item moving in a straight line between these positions. The same is true for scaling and rotation.</p>
<p>It is usual to use the class with a <a href="qtimeline.html">QTimeLine</a>. The timeline's <a href="qtimeline.html#valueChanged">valueChanged()</a> signal is then connected to the <tt>setStep()</tt> slot. For example, you can set up an item for rotation by calling <tt>setRotationAt()</tt> for different step values. The animations timeline is set with the <a href="qgraphicsitemanimation.html#setTimeLine">setTimeLine</a>() function.</p>
<p>An example animation with a timeline follows:</p>
<pre>     QGraphicsItem *ball = new QGraphicsEllipseItem(0, 0, 20, 20);

     QTimeLine *timer = new QTimeLine(5000);
     timer-&gt;setFrameRange(0, 100);

     QGraphicsItemAnimation *animation = new QGraphicsItemAnimation;
     animation-&gt;setItem(ball);
     animation-&gt;setTimeLine(timer);

     for (int i = 0; i &lt; 200; ++i)
         animation-&gt;setPosAt(i / 200.0, QPointF(i, i));

     QGraphicsScene *scene = new QGraphicsScene();
     scene-&gt;setSceneRect(0, 0, 250, 250);
     scene-&gt;addItem(ball);

     QGraphicsView *view = new QGraphicsView(scene);
     view-&gt;show();

     timer-&gt;start();</pre>
<p>Note that steps lie between 0.0 and 1.0. It may be necessary to use <a href="qtimeline.html#updateInterval-prop">setUpdateInterval()</a>. The default update interval is 40 ms. A scheduled transformation cannot be removed when set, so scheduling several transformations of the same kind (e.g., rotations) at the same step is not recommended.</p>
<p>See also <a href="qtimeline.html">QTimeLine</a> and <a href="graphicsview.html">The Graphics View Framework</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QGraphicsItemAnimation" />QGraphicsItemAnimation.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an animation object with the given <i>parent</i>.</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/~QGraphicsItemAnimation" />
<h3 class="fn"><a name="afterAnimationStep" />QGraphicsItemAnimation.afterAnimationStep (<i>self</i>, float)</h3><p>This method is meant to be overridden in subclasses that need to execute additional code after a new step has taken place. The animation <i>step</i> is provided for use in cases where the action depends on its value.</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/beforeAnimationStep" />
<h3 class="fn"><a name="beforeAnimationStep" />QGraphicsItemAnimation.beforeAnimationStep (<i>self</i>, float)</h3><p>This method is meant to be overridden by subclassed that needs to execute additional code before a new step takes place. The animation <i>step</i> is provided for use in cases where the action depends on its value.</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/clear" />
<h3 class="fn"><a name="clear" />QGraphicsItemAnimation.clear (<i>self</i>)</h3><p>Clears the scheduled transformations used for the animation, but retains the item and timeline.</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/horizontalScaleAt" />
<h3 class="fn"><a name="horizontalScaleAt" />float QGraphicsItemAnimation.horizontalScaleAt (<i>self</i>, float)</h3><p>Returns the horizontal scale for the item at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setScaleAt">setScaleAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/horizontalShearAt" />
<h3 class="fn"><a name="horizontalShearAt" />float QGraphicsItemAnimation.horizontalShearAt (<i>self</i>, float)</h3><p>Returns the horizontal shear for the item at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setShearAt">setShearAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/item" />
<h3 class="fn"><a name="item" /><a href="qgraphicsitem.html">QGraphicsItem</a> QGraphicsItemAnimation.item (<i>self</i>)</h3><p>Returns the item on which the animation object operates.</p>
<p>See also <a href="qgraphicsitemanimation.html#setItem">setItem</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/matrixAt" />
<h3 class="fn"><a name="matrixAt" /><a href="qmatrix.html">QMatrix</a> QGraphicsItemAnimation.matrixAt (<i>self</i>, float)</h3><p>Returns the matrix used to transform the item at the specified <i>step</i> value.</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/posAt" />
<h3 class="fn"><a name="posAt" /><a href="qpointf.html">QPointF</a> QGraphicsItemAnimation.posAt (<i>self</i>, float)</h3><p>Returns the position of the item at the given <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setPosAt">setPosAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/posList" />
<h3 class="fn"><a name="posList" />list-of-tuple-of-float-QPointF QGraphicsItemAnimation.posList (<i>self</i>)</h3><p>Returns all explicitly inserted positions.</p>
<p>See also <a href="qgraphicsitemanimation.html#posAt">posAt</a>() and <a href="qgraphicsitemanimation.html#setPosAt">setPosAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/rotationAt" />
<h3 class="fn"><a name="reset" />QGraphicsItemAnimation.reset (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void reset()</tt>.</p><h3 class="fn"><a name="rotationAt" />float QGraphicsItemAnimation.rotationAt (<i>self</i>, float)</h3><p>Returns the angle at which the item is rotated at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setRotationAt">setRotationAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/rotationList" />
<h3 class="fn"><a name="rotationList" />list-of-tuple-of-float-float QGraphicsItemAnimation.rotationList (<i>self</i>)</h3><p>Returns all explicitly inserted rotations.</p>
<p>See also <a href="qgraphicsitemanimation.html#rotationAt">rotationAt</a>() and <a href="qgraphicsitemanimation.html#setRotationAt">setRotationAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/scaleList" />
<h3 class="fn"><a name="scaleList" />list-of-tuple-of-float-QPointF QGraphicsItemAnimation.scaleList (<i>self</i>)</h3><p>Returns all explicitly inserted scales.</p>
<p>See also <a href="qgraphicsitemanimation.html#verticalScaleAt">verticalScaleAt</a>(), <a href="qgraphicsitemanimation.html#horizontalScaleAt">horizontalScaleAt</a>(), and <a href="qgraphicsitemanimation.html#setScaleAt">setScaleAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setItem" />
<h3 class="fn"><a name="setItem" />QGraphicsItemAnimation.setItem (<i>self</i>, <a href="qgraphicsitem.html">QGraphicsItem</a>)</h3><p>Sets the specified <i>item</i> to be used in the animation.</p>
<p>See also <a href="qgraphicsitemanimation.html#item">item</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setPosAt" />
<h3 class="fn"><a name="setPosAt" />QGraphicsItemAnimation.setPosAt (<i>self</i>, float, <a href="qpointf.html">QPointF</a>)</h3><p>Sets the position of the item at the given <i>step</i> value to the <i>point</i> specified.</p>
<p>See also <a href="qgraphicsitemanimation.html#posAt">posAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setRotationAt" />
<h3 class="fn"><a name="setRotationAt" />QGraphicsItemAnimation.setRotationAt (<i>self</i>, float, float)</h3><p>Sets the rotation of the item at the given <i>step</i> value to the <i>angle</i> specified.</p>
<p>See also <a href="qgraphicsitemanimation.html#rotationAt">rotationAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setScaleAt" />
<h3 class="fn"><a name="setScaleAt" />QGraphicsItemAnimation.setScaleAt (<i>self</i>, float, float, float)</h3><p>Sets the scale of the item at the given <i>step</i> value using the horizontal and vertical scale factors specified by <i>sx</i> and <i>sy</i>.</p>
<p>See also <a href="qgraphicsitemanimation.html#verticalScaleAt">verticalScaleAt</a>() and <a href="qgraphicsitemanimation.html#horizontalScaleAt">horizontalScaleAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setShearAt" />
<h3 class="fn"><a name="setShearAt" />QGraphicsItemAnimation.setShearAt (<i>self</i>, float, float, float)</h3><p>Sets the shear of the item at the given <i>step</i> value using the horizontal and vertical shear factors specified by <i>sh</i> and <i>sv</i>.</p>
<p>See also <a href="qgraphicsitemanimation.html#verticalShearAt">verticalShearAt</a>() and <a href="qgraphicsitemanimation.html#horizontalShearAt">horizontalShearAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setStep" />
<h3 class="fn"><a name="setStep" />QGraphicsItemAnimation.setStep (<i>self</i>, float)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setStep(qreal)</tt>.</p><p>Sets the current <i>step</i> value for the animation, causing the transformations scheduled at this step to be performed.</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setTimeLine" />
<h3 class="fn"><a name="setTimeLine" />QGraphicsItemAnimation.setTimeLine (<i>self</i>, <a href="qtimeline.html">QTimeLine</a>)</h3><p>Sets the timeline object used to control the rate of animation to the <i>timeLine</i> specified.</p>
<p>See also <a href="qgraphicsitemanimation.html#timeLine">timeLine</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/setTranslationAt" />
<h3 class="fn"><a name="setTranslationAt" />QGraphicsItemAnimation.setTranslationAt (<i>self</i>, float, float, float)</h3><p>Sets the translation of the item at the given <i>step</i> value using the horizontal and vertical coordinates specified by <i>dx</i> and <i>dy</i>.</p>
<p>See also <a href="qgraphicsitemanimation.html#xTranslationAt">xTranslationAt</a>() and <a href="qgraphicsitemanimation.html#yTranslationAt">yTranslationAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/shearList" />
<h3 class="fn"><a name="shearList" />list-of-tuple-of-float-QPointF QGraphicsItemAnimation.shearList (<i>self</i>)</h3><p>Returns all explicitly inserted shears.</p>
<p>See also <a href="qgraphicsitemanimation.html#verticalShearAt">verticalShearAt</a>(), <a href="qgraphicsitemanimation.html#horizontalShearAt">horizontalShearAt</a>(), and <a href="qgraphicsitemanimation.html#setShearAt">setShearAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/timeLine" />
<h3 class="fn"><a name="timeLine" /><a href="qtimeline.html">QTimeLine</a> QGraphicsItemAnimation.timeLine (<i>self</i>)</h3><p>Returns the timeline object used to control the rate at which the animation occurs.</p>
<p>See also <a href="qgraphicsitemanimation.html#setTimeLine">setTimeLine</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/translationList" />
<h3 class="fn"><a name="translationList" />list-of-tuple-of-float-QPointF QGraphicsItemAnimation.translationList (<i>self</i>)</h3><p>Returns all explicitly inserted translations.</p>
<p>See also <a href="qgraphicsitemanimation.html#xTranslationAt">xTranslationAt</a>(), <a href="qgraphicsitemanimation.html#yTranslationAt">yTranslationAt</a>(), and <a href="qgraphicsitemanimation.html#setTranslationAt">setTranslationAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/verticalScaleAt" />
<h3 class="fn"><a name="verticalScaleAt" />float QGraphicsItemAnimation.verticalScaleAt (<i>self</i>, float)</h3><p>Returns the vertical scale for the item at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setScaleAt">setScaleAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/verticalShearAt" />
<h3 class="fn"><a name="verticalShearAt" />float QGraphicsItemAnimation.verticalShearAt (<i>self</i>, float)</h3><p>Returns the vertical shear for the item at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setShearAt">setShearAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/xTranslationAt" />
<h3 class="fn"><a name="xTranslationAt" />float QGraphicsItemAnimation.xTranslationAt (<i>self</i>, float)</h3><p>Returns the horizontal translation of the item at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setTranslationAt">setTranslationAt</a>().</p>
<a name="//apple_ref/cpp/instm/QGraphicsItemAnimation/yTranslationAt" />
<h3 class="fn"><a name="yTranslationAt" />float QGraphicsItemAnimation.yTranslationAt (<i>self</i>, float)</h3><p>Returns the vertical translation of the item at the specified <i>step</i> value.</p>
<p>See also <a href="qgraphicsitemanimation.html#setTranslationAt">setTranslationAt</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>