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.