内容表

上一话题

QAbstractProxyModel

下一话题

QAbstractTableModel

QAbstractState

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

Inheritance diagram of PySide2.QtCore.QAbstractState

继承者: QFinalState , QHistoryState , QState , QStateMachine

4.6 版新增。

概要

函数

虚函数

信号

详细描述

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 状态机框架 .

entered() signal is emitted when the state has been entered. The exited() signal is emitted when 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.

class QAbstractState ( [ parent=None ] )
param parent

QState

Constructs a new state with the given parent 状态。

PySide2.QtCore.QAbstractState. active ( )
返回类型

bool

Returns whether this state is active.

另请参阅

activeChanged(bool) entered() exited()

PySide2.QtCore.QAbstractState. activeChanged ( active )
参数

active bool

PySide2.QtCore.QAbstractState. machine ( )
返回类型

QStateMachine

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

PySide2.QtCore.QAbstractState. onEntry ( event )
参数

event QEvent

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.

PySide2.QtCore.QAbstractState. onExit ( event )
参数

event QEvent

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.

PySide2.QtCore.QAbstractState. parentState ( )
返回类型

QState

Returns this state’s parent state, or None if the state has no parent state.