本页内容

Qt OPC UA

该 Qt OPC UA 该模块基于open62541库,实现了用于与 OPC UA 服务器交互的 Qt OPC UA API。

该 Qt Qml API 在 Qt 6.9 中已被标记为弃用,并将在未来的版本中移除。

使用该模块

QML API

可通过QtOpcUa 导入使用QML types 。要使用这些类型,请在您的.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 由The Qt Company 提供商业许可。此外,它还提供自由软件许可:GNU 较少通用公共许可证第 3 版或GNU 通用公共许可证第 2 版。更多详情请参阅Qt 许可。

此外,Qt 6.12.0 中的Qt OPC UA 可能包含遵循以下宽松许可协议的第三方模块:

Open62541, version v1.5.7

Mozilla 公共许可证 2.0、知识共享零版 v1.0 通用许可证、知识共享署名-相同方式共享 4.0 国际许可证、BSD 三条款“新”或“修订”许可证、Apache 许可证 2.0 以及 MIT 许可证

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