qt_add_statecharts
将.scxml 文件转换为 C++ 源代码。
该命令在 Qt 6.1 中引入。
该命令在Qt6 软件包的Scxml 组件中定义。用以下命令加载软件包:
find_package(Qt6 REQUIRED COMPONENTS Scxml)
简介
qt_add_statecharts(<TARGET> file1.scxml [file2.scxml ...]
[OPTIONS ...])如果禁用了无版本命令,请使用qt6_add_statecharts() 代替。它支持与此命令相同的参数集。
说明
qt_add_statecharts 宏指示 CMake 调用qscxmlc 工具读取所提供的.scxml 文件并生成 C++ 源文件和头文件,其中包含实现 SCXML 中定义的状态机的类。
有关进一步的说明、选项和示例,请参阅使用Qt SCXML 编译器 (qscxmlc)
© 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.