Qt State Machine

The State Machine framework provides classes for creating and executing state graphs.

使用模塊

QML API

The QML types of the module are available through the QtQml.StateMachine 導入。要使用類型,添加以下 import 語句到 .qml 文件:

import QtQml.StateMachine
					

C++ API

Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .

構建采用 CMake

使用 find_package() command to locate the needed module component in the Qt6 包:

find_package(Qt6 REQUIRED COMPONENTS StateMachine)
target_link_libraries(mytarget PRIVATE Qt6::StateMachine)
					

更多細節,見 構建采用 CMake 概述。

采用 qmake 構建

使用 find_package() command to locate the needed module component in the Qt6 包:

find_package(Qt6 REQUIRED COMPONENTS statemachine)
target_link_libraries(mytarget PRIVATE Qt6::statemachine)
					

更多細節,見 構建采用 CMake 概述。

文章和指南

範例

參考

Module Evolution

Changes to Qt State Machine lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.

許可和商標

The Qt State Machine module is available under commercial licenses from Qt 公司 . In addition, it is available under free software licenses: The GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。

Furthermore, Qt State Machine in Qt 6.5.1 may contain third party modules under following permissive licenses: