本页内容

QOpcUaReadItem Class

该类用于存储读取操作的选项。更多内容...

头文件: #include <QOpcUaReadItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

公共函数

QOpcUaReadItem()
QOpcUaReadItem(const QString &nodeId, QOpcUa::NodeAttribute attr = QOpcUa::NodeAttribute::Value, const QString &indexRange = QString())
QOpcUaReadItem(const QOpcUaReadItem &other)
QOpcUa::NodeAttribute attribute() const
QString indexRange() const
QString nodeId() const
void setAttribute(QOpcUa::NodeAttribute attribute)
void setIndexRange(const QString &indexRange)
void setNodeId(const QString &nodeId)
QOpcUaReadItem &operator=(const QOpcUaReadItem &rhs)
bool operator!=(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)
bool operator==(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)

详细说明

对 OPC UA 服务器的读取操作将返回服务器上某个节点的属性值的完整值或该值的特定索引范围。该类包含后端向服务器发送读取请求所需的必要信息。

一个或多个该类的对象共同构成QOpcUaClient::readNodeAttributes()操作的请求。

另请参阅 QOpcUaClient::readNodeAttributes() 和QOpcUaReadResult 。

成员函数文档

QOpcUaReadItem::QOpcUaReadItem()

默认情况下会构建一个未设置任何参数的读取项。

QOpcUaReadItem::QOpcUaReadItem(const QString &nodeId, QOpcUa::NodeAttribute attr = QOpcUa::NodeAttribute::Value, const QString &indexRange = QString())

为节点nodeId 的属性attr 构建一个读取项,其索引范围为indexRange 。

QOpcUaReadItem::QOpcUaReadItem(const QOpcUaReadItem &other)

根据other 构建一个读取项。

QOpcUa::NodeAttribute QOpcUaReadItem::attribute() const

返回节点的 id 属性。

另请参阅 ` setAttribute()`。

QString QOpcUaReadItem::indexRange() const

返回索引范围。

另请参阅 setIndexRange()。

QString QOpcUaReadItem::nodeId() const

返回节点 ID。

另请参阅 setNodeId()。

void QOpcUaReadItem::setAttribute(QOpcUa::NodeAttribute attribute)

将节点属性 id 设置为attribute 。

另请参阅 attribute()。

void QOpcUaReadItem::setIndexRange(const QString &indexRange)

将索引范围设置为indexRange 。

另请参阅 indexRange()。

void QOpcUaReadItem::setNodeId(const QString &nodeId)

将节点 ID 设置为nodeId 。

另请参阅 nodeId()。

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

将rhs 中的值设置到此读取项中。

相关非成员

[noexcept] bool operator!=(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)

如果lhs 不等于rhs ,则返回true ;否则返回false 。

如果两个读取项的nodeId 、attribute 或indexRange 不相等,则认为它们不相等。

[noexcept] bool operator==(const QOpcUaReadItem &lhs, const QOpcUaReadItem &rhs)

如果lhs 等于rhs ,则返回true ;否则返回false 。

如果两个读取项的nodeId 、attribute 和indexRange 均相等,则认为它们相等。

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