QOpcUaProvider creates an instance of QOpcUaClient . 更多...
| 頭: | #include <QOpcUaProvider> |
| qmake: | QT += opcua |
| 繼承: | QObject |
| QOpcUaProvider (QObject * parent = nullptr) | |
| QOpcUaClient * | createClient (const QString & backend , const QVariantMap & backendProperties = QVariantMap()) |
| QStringList | availableBackends () |
QOpcUaProvider allows the user to create an instance of QOpcUaClient by loading a QOpcUaPlugin using the Qt plugin system.
For the available plugins and their capabilities please refer to the introduction .
This code creates a client using the first available backend:
QOpcUaProvider provider; QStringList available = provider.availableBackends(); if (!available.isEmpty()) { QOpcUaClient *client = provider.createClient(available[0]); if (client) qDebug() << "Client successfully created"; }
Creates a new OPC UA provider with a given parent .
[static]
QStringList
QOpcUaProvider::
availableBackends
()
返迴 QStringList of available plugins.
返迴指針指嚮
QOpcUaClient
object by loading the selected
backend
as a plugin and creating a client object. If the plugin loading fails,
nullptr
被返迴取而代之。
The user is responsible for deleting the returned QOpcUaClient object when it is no longer needed.
The optional argument backendProperties can be used to pass custom backend specific settings as key value pairs. Those settings are specific to the backend being instantiated.
Available settings are
| Setting string | Backend | 描述 |
|---|---|---|
| disableEncryptedPasswordCheck | Unified Automation | By default, the backend refuses to connect to endpoints without encryption to avoid sending passwords in clear text. This parameter allows to disable this feature. |
| enableVerboseDebugOutput | Unified Automation |
Tells the backend to print additional output to the terminal. The backend specific logging level is set to
OPCUA_TRACE_OUTPUT_LEVEL_ALL
.
|
| minimumClientIterateIntervalMs | open62541 | Defines the client iterate interval for the backend. This value can be used to make a tradeoff between reaction time for subscriptions and CPU load. The default value is 50ms. |
注意: 此函數可以被援引,通過元對象係統和從 QML。見 Q_INVOKABLE .