QOpcUaProvider Class

QOpcUaProvider creates an instance of QOpcUaClient. More...

Header: #include <QOpcUaProvider>
qmake: QT += opcua
Inherits: QObject

Public Functions

QOpcUaProvider(QObject *parent = nullptr)
virtual ~QOpcUaProvider() override
QOpcUaClient *createClient(const QString &backend)
  • 34 public functions inherited from QObject

Static Public Members

QStringList availableBackends()
  • 10 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 2 signals inherited from QObject
  • 1 public variable inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

QOpcUaProvider creates an instance of QOpcUaClient.

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";

Member Function Documentation

QOpcUaProvider::QOpcUaProvider(QObject *parent = nullptr)

Creates a new OPC UA provider with a given parent.

[override virtual] QOpcUaProvider::~QOpcUaProvider()

Destroys the instance of QOpcUaProvider. The destructor is virtual.

[static] QStringList QOpcUaProvider::availableBackends()

Returns a QStringList of available plugins.

QOpcUaClient *QOpcUaProvider::createClient(const QString &backend)

Returns a pointer to a QOpcUaClient object by loading the selected backend as a plugin and creating a client object. If the plugin loading fails, nullptr is returned instead.

The user is responsible for deleting the returned QOpcUaClient object when it is no longer needed.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

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