diff options
author | Tobias Koenig <tokoe@kde.org> | 2009-06-10 15:11:59 (GMT) |
---|---|---|
committer | Tobias Koenig <tokoe@kde.org> | 2009-06-10 15:11:59 (GMT) |
commit | f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5 (patch) | |
tree | 045fbf67a4806e4e217ef23cdf4f363ac359bef1 /doc/src/animation.qdoc | |
parent | 5d87f2542bbcb0877f4a9a9b5be4df80cd6aa4cd (diff) | |
parent | 5b24c5793607c809b1bac82c7cc3696001ee9217 (diff) | |
download | Qt-f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5.zip Qt-f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5.tar.gz Qt-f1e6e89f7ee452af0e4404af537f5fed2a2b2dc5.tar.bz2 |
Merge branch 'master' of git://gitorious.org/qt/qt
Diffstat (limited to 'doc/src/animation.qdoc')
-rw-r--r-- | doc/src/animation.qdoc | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/doc/src/animation.qdoc b/doc/src/animation.qdoc index b4e603c..c16d6a2 100644 --- a/doc/src/animation.qdoc +++ b/doc/src/animation.qdoc @@ -327,14 +327,14 @@ \section1 Animations and States When using a \l{The State Machine Framework}{state machine}, we - have a special state, QAnimationState, that will play one or more - animations. - - The QState::addAnimatedTransition() convenience function lets you - associate an animation to a state transition. The function will - create the QAnimationState for you, and insert it into the state - machine. We also have the possibility to associate properties with - the states rather than setting the start and end values ourselves. + can associate an animation to a transition between states using a + QSignalTransition or QEventTransition class. These classes are both + derived from QAbstractClass, which defines the convenience function + addAnimation() that enables the appending of one or more animations + triggered when the transition occurs. + + We also have the possibility to associate properties with the + states rather than setting the start and end values ourselves. Below is a complete code example that animates the geometry of a QPushButton. @@ -345,18 +345,19 @@ QStateMachine *machine = new QStateMachine; QState *state1 = new QState(machine->rootState()); - state1->setPropertyOnEntry(button, "geometry", - QRect(0, 0, 100, 30)); + state1->assignProperty(button, "geometry", QRect(0, 0, 100, 30)); machine->setInitialState(state1); QState *state2 = new QState(machine->rootState()); - state2->setPropertyOnEntry(button, "geometry", - QRect(250, 250, 100, 30)); + state2->assignProperty(button, "geometry", QRect(250, 250, 100, 30)); - state1->addAnimatedTransition(button, SIGNAL(clicked()), state2, - new QPropertyAnimation(button, "geometry")); - state2->addAnimatedTransition(button, SIGNAL(clicked()), state1, - new QPropertyAnimation(button, "geometry")); + QSignalTransition *transition1 = state1->addTransition(button, + SIGNAL(clicked()), state2); + transition1->addAnimation(new QPropertyAnimation(button, "geometry")); + + QSignalTransition *transition2 = state2->addTransition(button, + SIGNAL(clicked()), state1); + transition2->addAnimation(new QPropertyAnimation(button, "geometry")); machine->start(); \endcode |