QAbstractState

Inheritance diagram of PySide2.QtCore.QAbstractState

Inherited by: QState, QStateMachine, QHistoryState, QFinalState

Note

This class was introduced in Qt 4.6.

Synopsis

Functions

Virtual functions

Signals

Detailed Description

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

The PySide2.QtCore.QAbstractState class is the abstract base class of states that are part of a PySide2.QtCore.QStateMachine . It defines the interface that all state objects have in common. PySide2.QtCore.QAbstractState is part of The State Machine Framework .

The entered() signal is emitted when the state has been entered. The exited() signal is emitted when the state has been exited.

The PySide2.QtCore.QAbstractState.parentState() function returns the state’s parent state. The PySide2.QtCore.QAbstractState.machine() function returns the state machine that the state is part of.

Subclassing

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

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

class PySide2.QtCore.QAbstractState([parent=nullptr])
Parameters:parentPySide2.QtCore.QState

Constructs a new state with the given parent state.

PySide2.QtCore.QAbstractState.active()
Return type:PySide2.QtCore.bool

Returns whether this state is active.

See also

activeChanged(bool)() entered() exited()

PySide2.QtCore.QAbstractState.activeChanged(active)
Parameters:activePySide2.QtCore.bool
PySide2.QtCore.QAbstractState.machine()
Return type:PySide2.QtCore.QStateMachine

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

PySide2.QtCore.QAbstractState.onEntry(event)
Parameters:eventPySide2.QtCore.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)
Parameters:eventPySide2.QtCore.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()
Return type:PySide2.QtCore.QState

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