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 state)는 최종 하위 상태( 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)를 재구현합니다.
© 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.