QScxmlInvokableService Class

QScxmlInvokableService 类是状态机调用服务的基类。更多

Header: #include <QScxmlInvokableService>
CMake: find_package(Qt6 REQUIRED COMPONENTS Scxml)
target_link_libraries(mytarget PRIVATE Qt6::Scxml)
qmake: QT += scxml
继承: QObject

属性

公共功能

virtual QString id() const = 0
virtual QString name() const = 0
QScxmlStateMachine *parentStateMachine() const
virtual void postEvent(QScxmlEvent *event) = 0
virtual bool start() = 0

详细说明

服务是通过SCXML 规范 - 6.4 <invoke> 中描述的机制从状态机中调用的该类表示被调用服务的实际实例。

属性文档

[read-only] id : const QString

该属性包含可调用服务的 ID。

ID 由<invoke> 元素的id 属性指定。

访问功能:

virtual QString id() const = 0

[read-only] name : const QString

该属性包含所调用服务的名称。

访问功能:

virtual QString name() const = 0

[read-only] parentStateMachine : QScxmlStateMachine* const

该属性包含调用服务的 SCXML 状态机。

访问函数:

QScxmlStateMachine *parentStateMachine() const

成员函数文档

[pure virtual] void QScxmlInvokableService::postEvent(QScxmlEvent *event)

向服务发送event

[pure virtual] bool QScxmlInvokableService::start()

启动可调用服务。成功时返回true ,调用失败时返回false

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