QAbstractState 類是狀態基類對於 QStateMachine . 更多...
| 頭: |
#include <QAbstractState>
|
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS StateMachine)
target_link_libraries(mytarget PRIVATE Qt6::StateMachine)
|
| qmake: |
QT += statemachine
|
| 繼承: | QObject |
| 繼承者: |
| virtual | ~QAbstractState () |
| bool | active () const |
| QBindable<bool> | bindableActive () |
| QStateMachine * | machine () const |
| QState * | parentState () const |
| void | activeChanged (bool active ) |
| void | entered () |
| void | exited () |
| QAbstractState (QState * parent = nullptr) | |
| virtual void | onEntry (QEvent * event ) = 0 |
| virtual void | onExit (QEvent * event ) = 0 |
| virtual bool | event (QEvent * e ) override |
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 Qt State Machine 框架 .
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.
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.
[bindable read-only]
active
:
bool
注意: 此特性支持 QProperty 綁定。
This property holds the active property of this state. A state is active between entered () 和 exited () 信號。
[protected]
QAbstractState::
QAbstractState
(
QState
*
parent
= nullptr)
構造新的狀態采用給定 parent 狀態。
[virtual noexcept]
QAbstractState::
~QAbstractState
()
銷毀此狀態。
Returns whether this state is active.
注意: Getter function for property active.
另請參閱 activeChanged (bool), entered (),和 exited ().
[signal]
void
QAbstractState::
activeChanged
(
bool
active
)
This signal is emitted when the active property is changed with active 作為自變量。
注意: 通知程序信號對於特性 active .
另請參閱 QAbstractState::active , entered (),和 exited ().
[private signal]
void
QAbstractState::
entered
()
This signal is emitted when the state has been entered (after onEntry () has been called).
注意: 這是私有信號。它可以用於信號連接,但不能由用戶發射。
[override virtual protected]
bool
QAbstractState::
event
(
QEvent
*
e
)
重實現: QObject::event (QEvent *e).
[private signal]
void
QAbstractState::
exited
()
This signal is emitted when the state has been exited (after onExit () has been called).
注意: 這是私有信號。它可以用於信號連接,但不能由用戶發射。
Returns the state machine that this state is part of, or
nullptr
if the state is not part of a state machine.
[pure virtual protected]
void
QAbstractState::
onEntry
(
QEvent
*
event
)
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.
[pure virtual protected]
void
QAbstractState::
onExit
(
QEvent
*
event
)
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.
Returns this state's parent state, or
nullptr
if the state has no parent state.