本页内容

关于Qt SCXML

Qt 6 的变更,是出于让该框架更高效、更易于使用的有意识努力。

我们力求在每个版本中保持所有公共 API 的二进制和源代码兼容性。但为了使 Qt 成为更优秀的框架,某些变更在所难免。

在本主题中,我们将总结Qt SCXML 模块中的这些变更,并提供处理这些变更的指导。

变更概述

Qt SCXML 模块在源代码层面与Qt5版本基本兼容,该库的用户应能够继续使用,无需对项目进行任何更改或仅需进行微调。

API 变更

移除了 QScxmlEcmaScriptDataModel API

启用 ecmascript 数据模型时,会引入对 Qt Qml 库的依赖。在 Qt5 中,该依赖是在构建时建立的,而在 Qt6 中,该依赖已移至运行时(内部为一个插件)。 因此,QScxmlEcmaScriptDataModel 类不再属于公共 API 的一部分。

构建系统

与 Qt6 的整体情况一致,Qt SCXML 模块除了支持 qmake 之外,还支持 CMake。

QML 导入

除非有特殊原因不使用最新版本,否则 QML 导入的版本号是可选的。一般而言,带版本号的导入在 5.8 至 6.x 版本之间有效,其中 'x' 表示当前的小版本号。

© 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.