The state machine in Qt Widgets
Classes in the State Machine framework are available for creating and executing state graphs. The State Machine framework provides an API and execution model for effectively embedding state chart elements and semantics in Qt applications. The framework is tightly integrated with Qt's meta-object system.
There was a major change to the State Machine framework in Qt 6. The APIs were missing from the Qt 6.0.x core module. With Qt 6.1, the module was restored as the statemachine module. So, you won't be able to run it in Qt 6.0.x versions and you will have to add statemachine
to the .pro
file to use the framework.
If you are using a qmake
based build system, then add the following line to your .pro
file:
QT += statemachine
If you are using a CMake based build system, then add the following to CMakeLists.txt
:
find_package(Qt6 COMPONENTS StateMachine REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::StateMachine)
You will need...