QAbstractState Class Reference

[ QtCore module]

QAbstractState 类是状态基类对于 QStateMachine . 更多...

继承 QObject .

Inherited by QFinalState , QHistoryState and QState .

方法

Qt Signals


详细描述

QAbstractState 类是状态基类对于 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 is part of The State Machine Framework .

entered () signal is emitted when the state has been entered. The exited () 信号被发射当 the state has been exited.

parentState () function returns the state's parent state. The machine () function returns the state machine that the state is part of.

子类化

onEntry () function is called when the state is entered; reimplement this function to perform custom processing when the state is entered.

onExit () function is called when the state is exited; reimplement this function to perform custom processing when the state is exited.


方法文档编制

QAbstractState.__init__ ( self , QState   parent  = None)

parent argument, if not None, causes self to be owned by Qt instead of PyQt.

Constructs a new state with the given parent 状态。

bool QAbstractState.event ( self , QEvent   e )

重实现自 QObject.event ().

QStateMachine QAbstractState.machine ( self )

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

QAbstractState.onEntry ( self , QEvent   event )

This method is abstract and should be reimplemented in any sub-class.

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.

QAbstractState.onExit ( self , QEvent   event )

This method is abstract and should be reimplemented in any sub-class.

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 ( self )

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


Qt Signal Documentation

void entered ()

This is the default overload of this signal.

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

void exited ()

This is the default overload of this signal.

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