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 |
詳細な説明
final状態は、QStateMachine の(一部が)処理を完了したことを伝えるために使用されます。トップレベルのfinal状態に入ると、ステートマシンのfinished()シグナルが発信されます。 一般に、最終サブ状態(QState の子)に入ると、親状態のfinished()シグナルが発信されます。QFinalStateは、Qt State Machine フレームワークの一部です。
最終状態を使用するには、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) を再実装します。
© 2026 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.