QFinalState Class
QFinalStateクラスは、最終状態を提供します。詳細...
ヘッダー | #include <QFinalState> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS StateMachine) target_link_libraries(mytarget PRIVATE Qt6::StateMachine) |
qmake: | QT += statemachine |
継承: | QAbstractState |
パブリック関数
QFinalState(QState *parent = nullptr) | |
virtual | ~QFinalState() |
再実装された保護された関数
virtual bool | event(QEvent *e) override |
virtual void | onEntry(QEvent *event) override |
virtual void | onExit(QEvent *event) override |
詳細な説明
最終状態は、QStateMachine (の一部)がその作業を終了したことを伝えるために使用される。最終トップレベル状態に入ると、ステートマシンのfinished() シグナルが発せられる。一般に、最終サブステート(QState の子)に入ると、親ステートのfinished() シグナルが出力されます。QFinalStateはQt State Machine Frameworkの一部です。
最終状態を使用するには、QFinalState オブジェクトを作成し、別の状態からその状態への遷移を追加します。例:
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();
QState::finished()も参照のこと 。
メンバ関数のドキュメント
QFinalState::QFinalState(QState *parent = nullptr)
与えられたparent の状態で新しい QFinalState オブジェクトを構築します。
[virtual noexcept]
QFinalState::~QFinalState()
この最終状態を破壊する。
[override virtual protected]
bool QFinalState::event(QEvent *e)
再インプリメント:QAbstractState::event(QEvent *e).
[override virtual protected]
void QFinalState::onEntry(QEvent *event)
再実装:QAbstractState::onEntry(QEvent *event)。
[override virtual protected]
void QFinalState::onExit(QEvent *event)
再実装:QAbstractState::onExit(QEvent *event)。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.