QAbstractState 類

The QAbstractState class is the base class of states of a QStateMachine . 更多...

頭: #include <QAbstractState>
Since: Qt 4.6
繼承: QObject
繼承者: QFinalState , QHistoryState ,和 QState

公共函數

~QAbstractState ()
QStateMachine * machine () const
QState * parentState () const

信號

void entered ()
void exited ()

保護函數

QAbstractState (QState * parent = 0)
virtual void onEntry (QEvent * event ) = 0
virtual void onExit (QEvent * event ) = 0

重實現保護函數

virtual bool event (QEvent * e )

額外繼承成員

詳細描述

The QAbstractState class is the base class of states of a QStateMachine .

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 屬於 狀態機框架 .

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.

子類化

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.

成員函數文檔編製

[protected] QAbstractState:: QAbstractState ( QState * parent = 0)

構造新的狀態采用給定 parent 狀態。

QAbstractState:: ~QAbstractState ()

銷毀此狀態。

[signal] void QAbstractState:: entered ()

This signal is emitted when the state has been entered (after onEntry () has been called).

[virtual protected] bool QAbstractState:: event ( QEvent * e )

重實現自 QObject::event ().

[signal] void QAbstractState:: exited ()

This signal is emitted when the state has been exited (after onExit () has been called).

QStateMachine * QAbstractState:: machine () const

Returns the state machine that this state is part of, or 0 if the state is not part of a state machine.

[pure virtual protected] void QAbstractState:: onEntry ( QEvent * event )

This function is called when the state is entered. The given event is what caused the state to be entered. Reimplement this function to perform custom processing when the state is entered.

[pure virtual protected] void QAbstractState:: onExit ( QEvent * event )

This function is called when the state is exited. The given event is what caused the state to be exited. Reimplement this function to perform custom processing when the state is exited.

QState * QAbstractState:: parentState () const

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