The Qt OPC UA module implements a Qt API to interact with OPC UA servers on top of the open62541 庫。
The QML API has been marked as deprecated in Qt 6.9 and will be removed in a future version.
The
QML 類型
是可用的透過
QtOpcUa
導入。要使用類型,添加以下 import 語句到 .qml 文件:
import QtOpcUa as QtOpcUa
使用 C++ API 要求直接或透過其它依賴鏈接到模塊庫。一些構建工具對此提供專用支持,包括 CMake 和 qmake。
使用
find_package()
命令以在 Qt6 包中定位所需的模塊組件:
find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget Qt::OpcUa)
要配置采用 qmake 構建模塊,把模塊作為 Qt 變量的值添加到工程 .pro 文件中:
QT += opcua
Qt OPC UA 在商業許可下是可用的來自 Qt 公司 。此外,它在自由軟件許可下也是可用的: GNU LGPL (次一般公共許可) 第 3 版 ,或 GNU GPL (一般公共許可) 第 2 版 。見 Qt 許可 進一步瞭解細節。
Furthermore, Qt OPC UA in Qt 6.10.1 may contain third-party modules under following permissive licenses:
| Mozilla Public License 2.0 and Creative Commons Zero v1.0 Universal and Creative Commons Attribution Share Alike 4.0 International and BSD 3-Clause "New" or "Revised" License and Apache License 2.0 and MIT License |