Home |
The QtFinalState class provides a final state. More...
#include <QtFinalState>
Inherits QtActionState.
The QtFinalState class provides a final state.
A final state is used to communicate that (part of) a QtStateMachine has finished its work. When a final top-level state is entered, the state machine's finished() signal is emitted. In general, when a final substate (a child of a QtState) is entered, a QtStateFinishedEvent is generated for the final state's parent state. QtFinalState is part of The State Machine Framework.
To use a final state, you create a QtFinalState object and add a transition to it from another state. Example:
QPushButton button; QtStateMachine machine; QtState *s1 = new QtState(); QtFinalState *s2 = new QtFinalState(); s1->addTransition(&button, SIGNAL(clicked()), s2); machine.addState(s1); machine.addState(s2); QObject::connect(&machine, SIGNAL(finished()), QApplication::instance(), SLOT(quit())); machine.setInitialState(s1); machine.start();
See also QtStateFinishedTransition.
Constructs a new QtFinalState object with the given parent state.
Destroys this final state.
Copyright © 2009 Nokia | Trademarks | Qt Solutions |