QOpcUaApplicationIdentity Class

QOpcUaApplicationIdentity definiert die Identität der Anwendung. Mehr...

Kopfzeile: #include <QOpcUaApplicationIdentity>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
Since: QtOpcUa 5.13

Öffentliche Funktionen

QOpcUaApplicationIdentity()
QOpcUaApplicationIdentity(const QOpcUaApplicationIdentity &other)
QString applicationName() const
QOpcUaApplicationDescription::ApplicationType applicationType() const
QString applicationUri() const
bool isValid() const
QString productUri() const
void setApplicationName(const QString &value)
void setApplicationType(QOpcUaApplicationDescription::ApplicationType value)
void setApplicationUri(const QString &value)
void setProductUri(const QString &value)
QOpcUaApplicationIdentity &operator=(const QOpcUaApplicationIdentity &rhs)

Detaillierte Beschreibung

Diese Information muss mit QOpcUaClient::setApplicationIdentity konfiguriert werden. Die Anwendungsidentität kann manuell eingerichtet oder von einem Zertifikat abgeleitet werden.

QOpcUaApplicationIdentity identity;

const QString applicationUri = QStringLiteral("urn:%1:%2:%3")
        .arg(QHostInfo::localHostName())
        .arg(QCoreApplication::organizationName())
        .arg(QCoreApplication::applicationName());
const QString productUri = QStringLiteral("urn:%1:%2")
        .arg(QCoreApplication::organizationName())
        .arg(QCoreApplication::applicationName());

identity.setProductUri(productUri);
identity.setApplicationUri(applicationUri);
identity.setApplicationName(QCoreApplication::applicationName());
identity.setApplicationType(QOpcUaApplicationDescription::Client);

client->setApplicationIdentity(identity);

Falls sich Ihre Anwendung mit Zertifikaten authentifiziert, muss die Anwendungsidentität mit dem verwendeten Zertifikat übereinstimmen. In diesem Fall werden alle Informationen aus dem in der PKI-Konfiguration angegebenen Zertifikat extrahiert.

QOpcUaApplicationIdentity identity;
identity = pkiConfig.applicationIdentity();

Mitgliederfunktion Dokumentation

QOpcUaApplicationIdentity::QOpcUaApplicationIdentity()

Standard konstruiert eine Anwendungsidentität ohne gesetzte Parameter.

QOpcUaApplicationIdentity::QOpcUaApplicationIdentity(const QOpcUaApplicationIdentity &other)

Konstruiert eine Anwendungsidentität aus other.

QString QOpcUaApplicationIdentity::applicationName() const

Gibt den von Menschen lesbaren Namen der Anwendung zurück. Dieser muss nicht eindeutig sein.

Siehe auch setApplicationName().

QOpcUaApplicationDescription::ApplicationType QOpcUaApplicationIdentity::applicationType() const

Gibt den Typ der Anwendung zurück.

Siehe auch setApplicationType().

QString QOpcUaApplicationIdentity::applicationUri() const

Gibt den AnwendungsURI der Anwendung zurück.

Dieser muss für jede Installationsinstanz der Anwendung eindeutig sein und mit der ApplicationURI im Zertifikat der Anwendung übereinstimmen.

Siehe auch setApplicationUri().

bool QOpcUaApplicationIdentity::isValid() const

Gibt true zurück, wenn die Anwendungsidentität gültige Daten enthält.

QString QOpcUaApplicationIdentity::productUri() const

Gibt die productUri der Anwendung zurück.

Diese identifiziert das Produkt eindeutig.

Siehe auch setProductUri().

void QOpcUaApplicationIdentity::setApplicationName(const QString &value)

Setzt den Anwendungsnamen auf value.

Siehe auch applicationName().

void QOpcUaApplicationIdentity::setApplicationType(QOpcUaApplicationDescription::ApplicationType value)

Legt den Typ der Anwendung fest. Client-Anwendungen sollten value auf Client setzen.

Der Standardwert ist Client.

Siehe auch applicationType().

void QOpcUaApplicationIdentity::setApplicationUri(const QString &value)

Setzt die applicationUri auf value.

Siehe auch applicationUri() und setApplicationName().

void QOpcUaApplicationIdentity::setProductUri(const QString &value)

Setzt die productUri auf value.

Siehe auch productUri().

QOpcUaApplicationIdentity &QOpcUaApplicationIdentity::operator=(const QOpcUaApplicationIdentity &rhs)

Legt die Werte von rhs in diesem QOpcUaApplicationIdentity fest.

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