本页内容

SCXML 兼容性

支持的数据模型

Qt SCXML 支持以下数据模型:

支持的元素和属性

Qt SCXML 的实现符合 SCXML 规范,但有以下例外:

  • 事件数据(_event.data )被实现为QVariant 。如果向<send> 传递参数,则QVariant 中包含一个QVariantMap ,因此不支持名称相同的多个参数。
  • 事件没有“原始”表示形式。
  • 不支持(可选的)基本 HTTP 事件 I/O 处理器。
  • <script> 标签和<data> 标签的内容必须对所选数据模型有效。例如:不支持 <data> 中的 XML 内容。但是,ECMAScript 数据模型支持 JSON 格式的数据。
  • 唯一可以使用<invoke> 实例化的服务是另一个 SCXML 状态机。
  • 为了保持动态创建的状态机与编译后的状态机的行为一致,不支持typeexpr和srcexpr属性。 此外,如果在<invoke> 标签内使用<content> 标签,其内容必须为 XML。具体来说,不支持动态创建 SCXML(例如通过将字符串与 ECMAScript 数据模型进行拼接)。

Qt SCXML 扩展

Qt SCXML 的实现以以下方式扩展了 SCXML:

  • 如果事件是错误事件,_event.errorMessage 将包含更详细的错误描述。

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