QAbstractState

QAbstractState

 

Header: #include <QAbstractState>
qmake: QT += core
Since: Qt 4.6
Inherits: QObject
Inherited By:

QFinalStateQHistoryState, and QState

 

 

 

 

 

 

 

Properties

  • 1 property inherited from QObject

 

Public Functions

  

virtual ~QAbstractState()
bool active() const
QStateMachine * machine() const
QState * parentState() const
  • 32 public functions inherited from QObject

 

Signals

 

void activeChanged(bool active)
void entered()
void exited()

 

 

 

 

  • 2 signals inherited from QObject

 

Protected Functions

 

  QAbstractState(QState *parent = nullptr)
virtual void onEntry(QEvent *event) = 0
virtual void onExit(QEvent *event) = 0

 

 

 

 

 

Reimplemented Protected Functions

 

virtual bool event(QEvent *e) override
  • 9 protected functions inherited from QO

 

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject

 

 

Detailed Description

The QAbstractState class is the base class of states of a 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.

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

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

 

Subclassing

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

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

 

 

 

 

 

 

############################

posted @ 2021-10-29 08:23  西北逍遥  阅读(60)  评论(0编辑  收藏  举报