|  | Home

# QtState Class Reference
[QtCore module]

The QtState class provides a default state implementation for QtStateMachine. More...

     #include <QtState>

Inherits QtAbstractStateGroup.

Inherited by QtAnimationState.

- List of all members, including inherited members

### Public Functions

- QtState ( QtAbstractStateGroup * parent = 0 )
- ~QtState ()
- QtAbstractState * initialState () const
- void setInitialState ( QtAbstractState * state )

- 20 public functions inherited from QtAbstractStateGroup
- 1 public function inherited from QtAbstractState
- 29 public functions inherited from QObject

### Additional Inherited Members

- 1 property inherited from QObject
- 1 public slot inherited from QObject
- 1 signal inherited from QObject
- 1 public type inherited from QObject
- 4 static public members inherited from QObject
- 2 protected functions inherited from QtAbstractState
- 7 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

The QtState class provides a default state implementation for QtStateMachine.

QtState is part of The State Machine Framework.

The setInitialState() function sets the initial state; this is only relevant for states that have child states. 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.

## Member Function Documentation

### QtState::QtState ( QtAbstractStateGroup * parent = 0 )

Constructs a new state with the given parent state.

### QtState::~QtState ()

Destroys this state.

### QtAbstractState * QtState::initialState () const

Returns this state's initial state, or 0 if the state has no initial state.

See also setInitialState().

### void QtState::setInitialState ( QtAbstractState * state )

Sets this state's initial state to be the given state. state has to be a child of this state.

See also initialState().