1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
|
<?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" />
<!-- qpropertyanimation.cpp -->
<title>Qt 4.8: QPropertyAnimation Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<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="qtcore.html">QtCore</a></li>
<li>QPropertyAnimation</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="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QPropertyAnimation Class Reference</h1>
<!-- $$$QPropertyAnimation-brief -->
<p>The QPropertyAnimation class animates Qt properties <a href="#details">More...</a></p>
<!-- @@@QPropertyAnimation -->
<pre class="cpp"> <span class="preprocessor">#include <QPropertyAnimation></span></pre><p><b>Inherits: </b><a href="qvariantanimation.html">QVariantAnimation</a>.</p>
<p>This class was introduced in Qt 4.6.</p>
<ul>
<li><a href="qpropertyanimation-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="qpropertyanimation.html#propertyName-prop">propertyName</a></b> : QByteArray</li>
<li class="fn"><b><a href="qpropertyanimation.html#targetObject-prop">targetObject</a></b> : QObject *</li>
</ul>
<ul>
<li class="fn">5 properties inherited from <a href="qvariantanimation.html#properties">QVariantAnimation</a></li>
<li class="fn">6 properties inherited from <a href="qabstractanimation.html#properties">QAbstractAnimation</a></li>
<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="qpropertyanimation.html#QPropertyAnimation">QPropertyAnimation</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#QPropertyAnimation-2">QPropertyAnimation</a></b> ( QObject * <i>target</i>, const QByteArray & <i>propertyName</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#dtor.QPropertyAnimation">~QPropertyAnimation</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#propertyName-prop">propertyName</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#propertyName-prop">setPropertyName</a></b> ( const QByteArray & <i>propertyName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#targetObject-prop">setTargetObject</a></b> ( QObject * <i>target</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QObject * </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#targetObject-prop">targetObject</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">13 public functions inherited from <a href="qvariantanimation.html#public-functions">QVariantAnimation</a></li>
<li class="fn">11 public functions inherited from <a href="qabstractanimation.html#public-functions">QAbstractAnimation</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#event">event</a></b> ( QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#updateCurrentValue">updateCurrentValue</a></b> ( const QVariant & <i>value</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qpropertyanimation.html#updateState">updateState</a></b> ( QAbstractAnimation::State <i>newState</i>, QAbstractAnimation::State <i>oldState</i> )</td></tr>
</table>
<ul>
<li class="fn">5 protected functions inherited from <a href="qvariantanimation.html#protected-functions">QVariantAnimation</a></li>
<li class="fn">4 protected functions inherited from <a href="qabstractanimation.html#protected-functions">QAbstractAnimation</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">6 public slots inherited from <a href="qabstractanimation.html#public-slots">QAbstractAnimation</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">1 signal inherited from <a href="qvariantanimation.html#signals">QVariantAnimation</a></li>
<li class="fn">4 signals inherited from <a href="qabstractanimation.html#signals">QAbstractAnimation</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">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">5 protected functions inherited from <a href="qvariantanimation.html#protected-functions">QVariantAnimation</a></li>
<li class="fn">4 protected functions inherited from <a href="qabstractanimation.html#protected-functions">QAbstractAnimation</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QPropertyAnimation-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QPropertyAnimation class animates Qt properties</p>
<p>QPropertyAnimation interpolates over <a href="properties.html#qt-s-property-system">Qt properties</a>. As property values are stored in <a href="qvariant.html">QVariant</a>s, the class inherits <a href="qvariantanimation.html">QVariantAnimation</a>, and supports animation of the same <a href="qvariant.html#Type-enum">variant types</a> as its super class.</p>
<p>A class declaring properties must be a <a href="qobject.html">QObject</a>. To make it possible to animate a property, it must provide a setter (so that QPropertyAnimation can set the property's value). Note that this makes it possible to animate many of Qt's widgets. Let's look at an example:</p>
<pre class="cpp"> <span class="type">QPropertyAnimation</span> <span class="operator">*</span>animation <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QPropertyAnimation</span>(myWidget<span class="operator">,</span> <span class="string">"geometry"</span>);
animation<span class="operator">-</span><span class="operator">></span><a href="qvariantanimation.html#duration-prop">setDuration</a>(<span class="number">10000</span>);
animation<span class="operator">-</span><span class="operator">></span><a href="qvariantanimation.html#startValue-prop">setStartValue</a>(<span class="type"><a href="qrect.html">QRect</a></span>(<span class="number">0</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="number">30</span>));
animation<span class="operator">-</span><span class="operator">></span><a href="qvariantanimation.html#endValue-prop">setEndValue</a>(<span class="type"><a href="qrect.html">QRect</a></span>(<span class="number">250</span><span class="operator">,</span> <span class="number">250</span><span class="operator">,</span> <span class="number">100</span><span class="operator">,</span> <span class="number">30</span>));
animation<span class="operator">-</span><span class="operator">></span><a href="qabstractanimation.html#start">start</a>();</pre>
<p>The property name and the <a href="qobject.html">QObject</a> instance of which property should be animated are passed to the constructor. You can then specify the start and end value of the property. The procedure is equal for properties in classes you have implemented yourself--just check with <a href="qvariantanimation.html">QVariantAnimation</a> that your <a href="qvariant.html">QVariant</a> type is supported.</p>
<p>The <a href="qvariantanimation.html">QVariantAnimation</a> class description explains how to set up the animation in detail. Note, however, that if a start value is not set, the property will start at the value it had when the QPropertyAnimation instance was created.</p>
<p>QPropertyAnimation works like a charm on its own. For complex animations that, for instance, contain several objects, <a href="qanimationgroup.html">QAnimationGroup</a> is provided. An animation group is an animation that can contain other animations, and that can manage when its animations are played. Look at <a href="qparallelanimationgroup.html">QParallelAnimationGroup</a> for an example.</p>
</div>
<p><b>See also </b><a href="qvariantanimation.html">QVariantAnimation</a>, <a href="qanimationgroup.html">QAnimationGroup</a>, and <a href="animation-overview.html">The Animation Framework</a>.</p>
<!-- @@@QPropertyAnimation -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$propertyName-prop$$$propertyName$$$setPropertyNameconstQByteArray& -->
<h3 class="fn"><a name="propertyName-prop"></a><span class="name">propertyName</span> : <span class="type"><a href="qbytearray.html">QByteArray</a></span></h3>
<p>This property holds the target property name for this animation.</p>
<p>This property defines the target property name for this animation. The property name is required for the animation to operate.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QByteArray </td><td class="memItemRight bottomAlign"><span class="name"><b>propertyName</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPropertyName</b></span> ( const QByteArray & <i>propertyName</i> )</td></tr>
</table>
<!-- @@@propertyName -->
<!-- $$$targetObject-prop$$$targetObject$$$setTargetObjectQObject* -->
<h3 class="fn"><a name="targetObject-prop"></a><span class="name">targetObject</span> : <span class="type"><a href="qobject.html">QObject</a></span> *</h3>
<p>This property holds the target QObject for this animation.</p>
<p>This property defines the target <a href="qobject.html">QObject</a> for this animation.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QObject * </td><td class="memItemRight bottomAlign"><span class="name"><b>targetObject</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setTargetObject</b></span> ( QObject * <i>target</i> )</td></tr>
</table>
<!-- @@@targetObject -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPropertyAnimation[overload1]$$$QPropertyAnimationQObject* -->
<h3 class="fn"><a name="QPropertyAnimation"></a>QPropertyAnimation::<span class="name">QPropertyAnimation</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Construct a <a href="qpropertyanimation.html">QPropertyAnimation</a> object. <i>parent</i> is passed to <a href="qobject.html">QObject</a>'s constructor.</p>
<!-- @@@QPropertyAnimation -->
<!-- $$$QPropertyAnimation$$$QPropertyAnimationQObject*constQByteArray&QObject* -->
<h3 class="fn"><a name="QPropertyAnimation-2"></a>QPropertyAnimation::<span class="name">QPropertyAnimation</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>target</i>, const <span class="type"><a href="qbytearray.html">QByteArray</a></span> & <i>propertyName</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Construct a <a href="qpropertyanimation.html">QPropertyAnimation</a> object. <i>parent</i> is passed to <a href="qobject.html">QObject</a>'s constructor. The animation changes the property <i>propertyName</i> on <i>target</i>. The default duration is 250ms.</p>
<p><b>See also </b><a href="qpropertyanimation.html#targetObject-prop">targetObject</a> and <a href="qpropertyanimation.html#propertyName-prop">propertyName</a>.</p>
<!-- @@@QPropertyAnimation -->
<!-- $$$~QPropertyAnimation[overload1]$$$~QPropertyAnimation -->
<h3 class="fn"><a name="dtor.QPropertyAnimation"></a>QPropertyAnimation::<span class="name">~QPropertyAnimation</span> ()</h3>
<p>Destroys the <a href="qpropertyanimation.html">QPropertyAnimation</a> instance.</p>
<!-- @@@~QPropertyAnimation -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QPropertyAnimation::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$updateCurrentValue[overload1]$$$updateCurrentValueconstQVariant& -->
<h3 class="fn"><a name="updateCurrentValue"></a><span class="type">void</span> QPropertyAnimation::<span class="name">updateCurrentValue</span> ( const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>value</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qvariantanimation.html#updateCurrentValue">QVariantAnimation::updateCurrentValue</a>().</p>
<p>This virtual function is called by <a href="qvariantanimation.html">QVariantAnimation</a> whenever the current value changes. <i>value</i> is the new, updated value. It updates the current value of the property on the target object.</p>
<p><b>See also </b><a href="qvariantanimation.html#currentValue-prop">currentValue</a> and <a href="qabstractanimation.html#currentTime-prop">currentTime</a>.</p>
<!-- @@@updateCurrentValue -->
<!-- $$$updateState[overload1]$$$updateStateQAbstractAnimation::StateQAbstractAnimation::State -->
<h3 class="fn"><a name="updateState"></a><span class="type">void</span> QPropertyAnimation::<span class="name">updateState</span> ( <span class="type"><a href="qabstractanimation.html#State-enum">QAbstractAnimation::State</a></span> <i>newState</i>, <span class="type"><a href="qabstractanimation.html#State-enum">QAbstractAnimation::State</a></span> <i>oldState</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qabstractanimation.html#updateState">QAbstractAnimation::updateState</a>().</p>
<p>If the <a href="qvariantanimation.html#startValue-prop">startValue</a> is not defined when the state of the animation changes from Stopped to Running, the current property value is used as the initial value for the animation.</p>
<!-- @@@updateState -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation 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>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
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>
</body>
</html>
|