diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-18 14:26:50 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-24 20:10:25 +0200 |
commit | a735038376e1c229c293c36bd67800851323baf1 (patch) | |
tree | 4b0621b9a0b322ecb45e3843b3d7c3bacd90296f /src/corelib/doc/src/animation.qdoc | |
parent | 43f01ec2e5bc52b290098d0fca1dd4ae40f2c6d3 (diff) |
Move QStateMachine from QtCore to QtScxml
Task-number: QTBUG-80316
Change-Id: I2ee74110fd55e94d86321d3b3dc5bb8297424ed4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/corelib/doc/src/animation.qdoc')
-rw-r--r-- | src/corelib/doc/src/animation.qdoc | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/corelib/doc/src/animation.qdoc b/src/corelib/doc/src/animation.qdoc index 9cbe50d4a9..16569ded0b 100644 --- a/src/corelib/doc/src/animation.qdoc +++ b/src/corelib/doc/src/animation.qdoc @@ -326,47 +326,4 @@ it to another group. This way, you can build a tree structure of animations which specifies when the animations are played in relation to each other. - - \section1 Animations and States - - When using a \l{The State Machine Framework}{state machine}, we - can associate one or more animations to a transition between states - using a QSignalTransition or QEventTransition class. These classes - are both derived from QAbstractTransition, which defines the - convenience function \l{QAbstractTransition::}{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. - - \code - QPushButton *button = new QPushButton("Animated Button"); - button->show(); - - QStateMachine *machine = new QStateMachine; - - QState *state1 = new QState(machine); - state1->assignProperty(button, "geometry", QRect(0, 0, 100, 30)); - machine->setInitialState(state1); - - QState *state2 = new QState(machine); - state2->assignProperty(button, "geometry", QRect(250, 250, 100, 30)); - - QSignalTransition *transition1 = state1->addTransition(button, - &QPushButton::clicked, state2); - transition1->addAnimation(new QPropertyAnimation(button, "geometry")); - - QSignalTransition *transition2 = state2->addTransition(button, - &QPushButton::clicked, state1); - transition2->addAnimation(new QPropertyAnimation(button, "geometry")); - - machine->start(); - \endcode - - For a more comprehensive example of how to use the state machine - framework for animations, see the states example (it lives in the - \c{examples/animation/states} directory). */ |