Home |
The QtState class provides a general-purpose state for QtStateMachine. More...
#include <QtState>
Inherits QtActionState.
The QtState class provides a general-purpose state for QtStateMachine.
QtState objects can have child states, and can have transitions to other states. QtState is part of The State Machine Framework.
The addTransition() function adds a transition. The removeTransition() function removes a transition.
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 addHistoryState() function adds a history state.
The addFinishedTransition() function creates and adds a transition that's triggered when a final child state 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).
This enum specifies the type of history that a QtHistoryState records.
Constant | Value | Description |
---|---|---|
QtState::ShallowHistory | 0 | Only the immediate child states of the parent state are recorded. In this case a transition with the history state as its target will end up in the immediate child state that the parent was in the last time it was exited. This is the default. |
QtState::DeepHistory | 1 | Nested states are recorded. In this case a transition with the history state as its target will end up in the most deeply nested descendant state the parent was in the last time it was exited. |
This enum specifies the type of a state.
Constant | Value | Description |
---|---|---|
QtState::Normal | 0 | A normal state. If the state has no child states, it is an atomic state; otherwise, the child states are mutually exclusive and an initial state must be set by calling QtState::setInitialState(). |
QtState::ParallelGroup | 1 | The state is a parallel group state. When a parallel group state is entered, all its child states are entered in parallel. |
Constructs a new state with the given parent state.
Constructs a new state of the given type with the given parent state.
Destroys this state.
Adds a transition that's triggered by the finished event of this state, and returns the new QtStateFinishedTransition object. The transition has the given target state.
See also QtStateFinishedEvent.
Creates a history state of the given type for this state and returns the new state. The history state becomes a child of this state.
Adds the given transition. The transition has this state as the source. This state takes ownership of the transition.
This is an overloaded member function, provided for convenience.
Adds a transition associated with the given signal of the given sender object, and returns the new QtSignalTransition object. The transition has this state as the source, and the given target as the target state.
This is an overloaded member function, provided for convenience.
Adds an unconditional transition from this state to the given target state, and returns then new transition object.
Returns this state group's error state.
See also QtStateMachine::errorState() and QtStateMachine::setErrorState().
Returns this state's initial state, or 0 if the state has no initial state.
See also setInitialState().
Removes the given transition from this state. The state releases ownership of the transition.
See also addTransition().
Sets this state's error state to be the given state. If the error state is not set, or if it is set to 0, the state will inherit its parent's error state recursively.
See also QtStateMachine::setErrorState() and QtStateMachine::errorState().
Sets this state's initial state to be the given state. state has to be a child of this state.
See also initialState().
Returns the list of transitions from this state, or an empty list if there are no transitions from this state.
See also addTransition() and removeTransition().
Copyright © 2009 Nokia | Trademarks | Qt Solutions |