本页内容

QScxmlDynamicScxmlServiceFactory Class

QScxmlDynamicScxmlServiceFactory 类可从运行时加载的文档中创建 SCXML 服务实例。更多内容...

标题: #include <QScxmlDynamicScxmlServiceFactory>
CMake: find_package(Qt6 REQUIRED COMPONENTS Scxml)
target_link_libraries(mytarget PRIVATE Qt6::Scxml)
qmake: QT += scxml
继承自: QScxmlInvokableServiceFactory

公共函数

QScxmlDynamicScxmlServiceFactory(const QScxmlExecutableContent::InvokeInfo &invokeInfo, const QList<QScxmlExecutableContent::StringId> &names, const QList<QScxmlExecutableContent::ParameterInfo> &parameters, QObject *parent = nullptr)

重新实现的公共函数

virtual QScxmlInvokableService *invoke(QScxmlStateMachine *parentStateMachine) override

详细说明

当从文件中加载SCXML内容时,会使用动态解析的服务。这些文件是由父状态机在运行时通过 `<invoke> ` 元素中的 `srcexpr ` 属性请求的。

成员函数文档

QScxmlDynamicScxmlServiceFactory::QScxmlDynamicScxmlServiceFactory(const QScxmlExecutableContent::InvokeInfo &invokeInfo, const QList<QScxmlExecutableContent::StringId> &names, const QList<QScxmlExecutableContent::ParameterInfo> &parameters, QObject *parent = nullptr)

创建一个用于动态解析服务的工厂,将<invoke> 元素的属性作为invokeInfo 传递,将任何<param> 子元素作为parameters 传递,将names 属性的内容作为names 传递,并将QObject 父元素作为parent 传递。

[override virtual] QScxmlInvokableService *QScxmlDynamicScxmlServiceFactory::invoke(QScxmlStateMachine *parentStateMachine)

重写了:QScxmlInvokableServiceFactory::invoke (QScxmlStateMachine *parentStateMachine)。

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