内容表

上一话题

QFileSystemWatcher

下一话题

QGenericArgument

QFinalState

QFinalState class provides a final state. 更多

Inheritance diagram of PySide2.QtCore.QFinalState

4.6 版新增。

详细描述

最终状态用于传达 (属于) QStateMachine has finished its work. When a final top-level state is entered, the state machine’s finished () 信号被发射。通常,当最终子状态 (子级 QState ) is entered, the parent state’s finished () 信号被发射。 QFinalState is part of 状态机框架 .

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

另请参阅

finished()

class QFinalState ( [ parent=None ] )
param parent

QState

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