QFinalState Class Reference

[ QtCore module]

QFinalState 类提供最终状态。 更多...

继承 QAbstractState .

方法


详细描述

QFinalState 类提供最终状态。

最终状态用于传达 (属于) QStateMachine has finished its work. When a final top-level state is entered, the state machine's finished () signal is emitted. In general, when a final substate (a child of a QState ) 进入,父级状态的 finished () 信号被发射。 QFinalState is part of The State Machine Framework .

To use a final state, you create a QFinalState object and add a transition to it from another state. Example:

 QPushButton button;
 QStateMachine machine;
 QState *s1 = new QState();
 QFinalState *s2 = new QFinalState();
 s1->addTransition(&button, SIGNAL(clicked()), s2);
 machine.addState(s1);
 machine.addState(s2);
 QObject.connect(&machine, SIGNAL(finished()), QApplication.instance(), SLOT(quit()));
 machine.setInitialState(s1);
 machine.start();
			

方法文档编制

QFinalState.__init__ ( self , QState   parent  = None)

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

构造新 QFinalState 对象采用给定 parent 状态。

bool QFinalState.event ( self , QEvent   e )

重实现自 QObject.event ().

QFinalState.onEntry ( self , QEvent   event )

重实现自 QAbstractState.onEntry ().

QFinalState.onExit ( self , QEvent   event )

重实现自 QAbstractState.onExit ().