|  | Home

# QtAbstractState Class Reference
[QtCore module]

The QtAbstractState class is the base class of states of a QtStateMachine. More...

     #include <QtAbstractState>

Inherits QObject.

Inherited by QtAbstractStateGroup, QtFinalState, and QtHistoryState.

- List of all members, including inherited members

### Public Functions

- ~QtAbstractState ()
- QtAbstractStateGroup * parentState () const

- 29 public functions inherited from QObject

### Protected Functions

- QtAbstractState ( QtAbstractStateGroup * parent = 0 )
- virtual void onEntry () = 0
- virtual void onExit () = 0

- 7 protected 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 variables inherited from QObject

## Detailed Description

The QtAbstractState class is the base class of states of a QtStateMachine.

The QtAbstractState class is the abstract base class of states that are part of a QtStateMachine. It defines the interface that all state objects have in common. QtAbstractState is part of The State Machine Framework.

The parentState() function returns the state's parent state.

### 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.

## Member Function Documentation

### QtAbstractState::QtAbstractState ( QtAbstractStateGroup * parent = 0 ) `[protected]`

Constructs a new state with the given parent state.

### QtAbstractState::~QtAbstractState ()

Destroys this state.

### void QtAbstractState::onEntry () `[pure virtual protected]`

This function is called when the state is entered. Reimplement this function to perform custom processing when the state is entered.

### void QtAbstractState::onExit () `[pure virtual protected]`

This function is called when the state is exited. Reimplement this function to perform custom processing when the state is exited.

### QtAbstractStateGroup * QtAbstractState::parentState () const

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