Name Description Size Coverage
CMakeLists.txt 1847 -
doc -
gui -
qabstractstate.cpp ! \class QAbstractState \inmodule QtStateMachine \brief The QAbstractState class is the base class of states of a QStateMachine. \since 4.6 \ingroup statemachine The QAbstractState class is the abstract base class of states that are part of a QStateMachine. It defines the interface that all state objects have in common. QAbstractState is part of \l{Qt State Machine Overview}{Qt State Machine Framework}. The entered() signal is emitted when the state has been entered. The exited() signal is emitted when the state has been exited. The parentState() function returns the state's parent state. The machine() function returns the state machine that the state is part of. \section1 Subclassing The onEntry() function is called when the state is entered; reimplement this function to perform custom processing when the state is entered. The onExit() function is called when the state is exited; reimplement this function to perform custom processing when the state is exited. 4790 -
qabstractstate.h 1204 -
qabstractstate_p.h 1640 -
qabstracttransition.cpp ! \class QAbstractTransition \inmodule QtStateMachine \brief The QAbstractTransition class is the base class of transitions between QAbstractState objects. \since 4.6 \ingroup statemachine The QAbstractTransition class is the abstract base class of transitions between states (QAbstractState objects) of a QStateMachine. QAbstractTransition is part of \l{Qt State Machine Overview} {Qt State Machine Framework}. The sourceState() function returns the source of the transition. The targetStates() function returns the targets of the transition. The machine() function returns the state machine that the transition is part of. The triggered() signal is emitted when the transition has been triggered. Transitions can cause animations to be played. Use the addAnimation() function to add an animation to the transition. \section1 Subclassing The eventTest() function is called by the state machine to determine whether an event should trigger the transition. In your reimplementation you typically check the event type and cast the event object to the proper type, and check that one or more properties of the event meet your criteria. The onTransition() function is called when the transition is triggered; reimplement this function to perform custom processing for the transition. 11094 -
qabstracttransition.h 2389 -
qabstracttransition_p.h 1649 -
qeventtransition.cpp ! \class QEventTransition \inmodule QtStateMachine \brief The QEventTransition class provides a QObject-specific transition for Qt events. \since 4.6 \ingroup statemachine A QEventTransition object binds an event to a particular QObject. QEventTransition is part of \l{Qt State Machine Overview}{Qt State Machine Framework}. Example: \code QPushButton *button = ...; QState *s1 = ...; QState *s2 = ...; // If in s1 and the button receives an Enter event, transition to s2 QEventTransition *enterTransition = new QEventTransition(button, QEvent::Enter); enterTransition->setTargetState(s2); s1->addTransition(enterTransition); // If in s2 and the button receives an Exit event, transition back to s1 QEventTransition *leaveTransition = new QEventTransition(button, QEvent::Leave); leaveTransition->setTargetState(s1); s2->addTransition(leaveTransition); \endcode \section1 Subclassing When reimplementing the eventTest() function, you should first call the base implementation to verify that the event is a QStateMachine::WrappedEvent for the proper object and event type. You may then cast the event to a QStateMachine::WrappedEvent and get the original event by calling QStateMachine::WrappedEvent::event(), and perform additional checks on that object. \sa QState::addTransition() 5866 -
qeventtransition.h 1573 -
qeventtransition_p.h 1621 -
qfinalstate.cpp ! \class QFinalState \inmodule QtStateMachine \brief The QFinalState class provides a final state. \since 4.6 \ingroup statemachine A final state is used to communicate that (part of) a QStateMachine has finished its work. When a final top-level state is entered, the state machine's \l{QStateMachine::finished()}{finished}() signal is emitted. In general, when a final substate (a child of a QState) is entered, the parent state's \l{QState::finished()}{finished}() signal is emitted. QFinalState is part of \l{Qt State Machine Overview}{Qt State Machine Framework}. To use a final state, you create a QFinalState object and add a transition to it from another state. Example: \code QPushButton button; QStateMachine machine; QState *s1 = new QState(); QFinalState *s2 = new QFinalState(); 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(); \endcode \sa QState::finished() 2244 -
qfinalstate.h 779 -
qfinalstate_p.h 858 -
qhistorystate.cpp ! \class QHistoryState \inmodule QtStateMachine \brief The QHistoryState class provides a means of returning to a previously active substate. \since 4.6 \ingroup statemachine A history state is a pseudo-state that represents the child state that the parent state was in the last time the parent state was exited. A transition with a history state as its target is in fact a transition to one or more other child states of the parent state. QHistoryState is part of \l{Qt State Machine Overview} {Qt State Machine Framework}. Use the setDefaultState() function to set the state that should be entered if the parent state has never been entered. Example: \code QStateMachine machine; QState *s1 = new QState(); QState *s11 = new QState(s1); QState *s12 = new QState(s1); QHistoryState *s1h = new QHistoryState(s1); s1h->setDefaultState(s11); machine.addState(s1); QState *s2 = new QState(); machine.addState(s2); QPushButton *button = new QPushButton(); // Clicking the button will cause the state machine to enter the child state // that s1 was in the last time s1 was exited, or the history state's default // state if s1 has never been entered. s1->addTransition(button, SIGNAL(clicked()), s1h); \endcode If more than one default state has to be entered, or if the transition to the default state(s) has to be acted upon, the defaultTransition should be set instead. Note that the eventTest() method of that transition will never be called: the selection and execution of the transition is done automatically when entering the history state. By default a history state is shallow, meaning that it won't remember nested states. This can be configured through the historyType property. 8784 -
qhistorystate.h 1942 -
qhistorystate_p.h 1732 -
qsignaleventgenerator_p.h 943 -
qsignaltransition.cpp ! \class QSignalTransition \inmodule QtStateMachine \brief The QSignalTransition class provides a transition based on a Qt signal. \since 4.6 \ingroup statemachine Typically you would use the overload of QState::addTransition() that takes a sender and signal as arguments, rather than creating QSignalTransition objects directly. QSignalTransition is part of \l{Qt State Machine Overview} {Qt State Machine Framework}. You can subclass QSignalTransition and reimplement eventTest() to make a signal transition conditional; the event object passed to eventTest() will be a QStateMachine::SignalEvent object. Example: \code class CheckedTransition : public QSignalTransition { public: CheckedTransition(QCheckBox *check) : QSignalTransition(check, SIGNAL(stateChanged(int))) {} protected: bool eventTest(QEvent *e) { if (!QSignalTransition::eventTest(e)) return false; QStateMachine::SignalEvent *se = static_cast<QStateMachine::SignalEvent*>(e); return (se->arguments().at(0).toInt() == Qt::Checked); } }; ... QCheckBox *check = new QCheckBox(); check->setTristate(true); QState *s1 = new QState(); QState *s2 = new QState(); CheckedTransition *t1 = new CheckedTransition(check); t1->setTargetState(s2); s1->addTransition(t1); \endcode 7004 -
qsignaltransition.h 2101 -
qsignaltransition_p.h 1635 -
qstate.cpp ! \class QState \inmodule QtStateMachine \brief The QState class provides a general-purpose state for QStateMachine. \since 4.6 \ingroup statemachine QState objects can have child states, and can have transitions to other states. QState is part of \l{Qt State Machine Overview}{Qt State Machine Framework}. The addTransition() function adds a transition. The removeTransition() function removes a transition. The transitions() function returns the state's outgoing transitions. The assignProperty() function is used for defining property assignments that should be performed when a state is entered. Top-level states must be passed a QStateMachine object as their parent state, or added to a state machine using QStateMachine::addState(). \section1 States with Child States The childMode property determines how child states are treated. For non-parallel state groups, the setInitialState() function must be called to set the initial state. The child states are mutually exclusive states, and the state machine needs to know which child state to enter when the parent state is the target of a transition. The state emits the QState::finished() signal when a final child state (QFinalState) is entered. The setErrorState() sets the state's error state. The error state is the state that the state machine will transition to if an error is detected when attempting to enter the state (e.g. because no initial state has been set). 16318 -
qstate.h 3258 -
qstate_p.h 3352 -
qstatemachine.cpp 115391 -
qstatemachine.h 4751 -
qstatemachine_p.h 12718 -
qstatemachineglobal.h 433 -
qstatemachineglobal_p.h 603 -
qt_cmdline.cmake 0 -