本页内容

QOpcUaExpandedNodeId Class

OPC UA 的 ExpandedNodeId。更多内容...

标题: #include <QOpcUaExpandedNodeId>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

公共函数

QOpcUaExpandedNodeId()
QOpcUaExpandedNodeId(const QString &nodeId)
QOpcUaExpandedNodeId(const QString &namespaceUri, const QString &nodeId, quint32 serverIndex = 0)
QOpcUaExpandedNodeId(const QOpcUaExpandedNodeId &rhs)
QString namespaceUri() const
QString nodeId() const
quint32 serverIndex() const
void setNamespaceUri(const QString &namespaceUri)
void setNodeId(const QString &nodeId)
void setServerIndex(quint32 serverIndex)
operator QVariant() const
QOpcUaExpandedNodeId &operator=(const QOpcUaExpandedNodeId &rhs)
bool operator==(const QOpcUaExpandedNodeId &rhs) const

详细说明

扩展节点 ID 是指其命名空间索引既可以指定为索引值,也可以指定为字符串 URI 的节点 ID。服务器上的命名空间及其索引列表由QOpcUaClient::namespaceArray() 提供。

成员函数文档

QOpcUaExpandedNodeId::QOpcUaExpandedNodeId()

默认情况下,会构建一个未设置任何参数的展开节点 ID。

QOpcUaExpandedNodeId::QOpcUaExpandedNodeId(const QString &nodeId)

根据节点 ID 字符串nodeId 构建一个扩展的节点 ID。

QOpcUaExpandedNodeId::QOpcUaExpandedNodeId(const QString &namespaceUri, const QString &nodeId, quint32 serverIndex = 0)

根据命名空间 URInamespaceUri 、节点 ID 字符串nodeId 和服务器索引serverIndex 构建一个扩展节点 ID。

另请参阅 setServerIndex 。

QOpcUaExpandedNodeId::QOpcUaExpandedNodeId(const QOpcUaExpandedNodeId &rhs)

根据rhs 构建一个扩展节点ID。

QString QOpcUaExpandedNodeId::namespaceUri() const

返回节点 ID 的命名空间 URI。如果指定了此值,则nodeId 中的命名空间索引为 0,必须予以忽略。

另请参阅 setNamespaceUri()。

QString QOpcUaExpandedNodeId::nodeId() const

返回节点 ID。如果指定了namespaceUri ,则该命名空间索引无效。

另请参阅 setNodeId()。

quint32 QOpcUaExpandedNodeId::serverIndex() const

返回包含该节点的服务器的索引。该索引映射到该服务器服务器表中的一个条目。本地服务器的索引始终为0 。所有远程服务器的索引均大于0 。

另请参阅 setServerIndex()。

void QOpcUaExpandedNodeId::setNamespaceUri(const QString &namespaceUri)

将命名空间 URI 设置为namespaceUri 。

另请参阅 namespaceUri()。

void QOpcUaExpandedNodeId::setNodeId(const QString &nodeId)

将节点 ID 设置为nodeId 。

另请参阅 nodeId()。

void QOpcUaExpandedNodeId::setServerIndex(quint32 serverIndex)

将服务器索引设置为serverIndex 。本地服务器的索引始终为0 。所有远程服务器的索引均大于0 。

另请参阅 serverIndex()。

QOpcUaExpandedNodeId::operator QVariant() const

将此展开的节点 ID 转换为QVariant 。

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

将rhs 中的值设置到此展开节点的 ID 中。

bool QOpcUaExpandedNodeId::operator==(const QOpcUaExpandedNodeId &rhs) const

如果该展开后的节点 ID 与rhs 的值相同,则返回true 。

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