Qt OPC UA

Qt OPC UA模块在open62541库之上实现了与 OPC UA 服务器交互的 Qt API。

Qt Qml API 在 Qt 6.9 中已被标记为过时,并将在未来版本中删除。

使用模块

QML API

QML types 可通过QtOpcUa 导入。要使用这些类型,请在 .qml 文件中添加以下导入语句:

import QtOpcUa as QtOpcUa

C++ API

使用C++ API 需要直接或通过其他依赖关系与模块库链接。有几种构建工具对此提供了专门支持,包括 CMake 和 qmake。

使用 CMake 构建

使用find_package() 命令在 Qt6 软件包中找到所需的模块组件:

find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget Qt::OpcUa)

使用 qmake 构建

要配置模块以便使用 qmake 构建,请在项目的 .pro 文件中将模块添加为 QT 变量的值:

QT += opcua

文章与指南

示例

参考资料

许可和归属

Qt OPC UA OPC UA 在商业许可证下由Qt 公司提供。此外,它还受自由软件许可证的保护:GNU 宽通用公共许可证第 3 版GNU 通用公共许可证第 2 版。详情请参见Qt Licensing

此外,Qt 6.9.0 中的Qt OPC UA 可能包含以下许可下的第三方模块:

Open62541, version v1.4.9

Mozilla Public License 2.0 和 Creative Commons Zero v1.0 Universal 和 Creative Commons Attribution Share Alike 4.0 International 和 BSD 3-Clause "New" or "Revised" License 和 Apache License 2.0 和 MIT License。

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