The Qt OPC UA module implements a Qt API to interact with OPC UA on top of a 3rd party OPC UA stack.
The stacks are integrated as plugins and can be selected at runtime. Currently, the following implementations are supported:
The QML API is still in development but are available as a technology preview. This means those parts are unstable, likely to change, and provided as a convenience only.
The
QML 類型
are available through the
QtOpcUa
導入。要使用類型,添加以下 import 語句到 .qml 文件:
import QtOpcUa as QtOpcUa
使用 C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
使用
find_package()
command to locate the needed module components in the Qt6 package:
find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget Qt::OpcUa)
要配置采用 qmake 構建模塊,把模塊作為 Qt 變量的值添加到工程 .pro 文件中:
QT += opcua