diff options
author | Bruno Abinader <bruno.abinader@openbossa.org> | 2009-06-08 11:06:21 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-06-08 11:06:21 (GMT) |
commit | f38c81bfbae39c6f58d87b874d0abdee0d3ac8af (patch) | |
tree | 9126baef96ad8be4418abf82cf19f06adaf82e02 | |
parent | 508c9cd681244a5ad566c12733aa70f5bd522b57 (diff) | |
download | Qt-f38c81bfbae39c6f58d87b874d0abdee0d3ac8af.zip Qt-f38c81bfbae39c6f58d87b874d0abdee0d3ac8af.tar.gz Qt-f38c81bfbae39c6f58d87b874d0abdee0d3ac8af.tar.bz2 |
Reflected the state machine framework API changes on documentation.
Signed-off-by: Bruno Abinader <bruno.abinader@openbossa.org>
Merge-request: 602
Reviewed-by: David Boddie <dboddie@trolltech.com>
-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 |