QOpcUaWriteResult Class
该类用于存储写入操作的结果。更多内容...
| 头文件: | #include <QOpcUaWriteResult> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
| qmake: | QT += opcua |
公共函数
| QOpcUaWriteResult() | |
| QOpcUaWriteResult(const QOpcUaWriteResult &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) |
| void | setStatusCode(QOpcUa::UaStatusCode statusCode) |
| QOpcUa::UaStatusCode | statusCode() const |
| QOpcUaWriteResult & | operator=(const QOpcUaWriteResult &rhs) |
详细说明
对 OPC UA 服务器执行写入操作时,会返回一个状态码,该状态码用于描述值是否已成功写入;若未成功,则说明写入失败的原因。
除了服务器返回的状态码外,该类还包含请求中的节点ID、属性和索引范围,以便客户端将结果与请求进行匹配。
该类的对象在QOpcUaClient::writeNodeAttributesFinished()信号中返回,并包含作为QOpcUaClient::writeNodeAttributes()请求一部分的写入操作的结果。
另请参见 QOpcUaClient::writeNodeAttributes()、QOpcUaClient::writeNodeAttributesFinished() 和QOpcUaWriteItem 。
成员函数文档
QOpcUaWriteResult::QOpcUaWriteResult()
默认情况下,会生成一个未设置任何参数的写入结果。
QOpcUaWriteResult::QOpcUaWriteResult(const QOpcUaWriteResult &other)
根据other 构建写入结果。
QOpcUa::NodeAttribute QOpcUaWriteResult::attribute() const
返回写入结果的属性。
另请参阅 setAttribute()。
QString QOpcUaWriteResult::indexRange() const
返回写入结果的索引范围。
另请参阅 setIndexRange()。
QString QOpcUaWriteResult::nodeId() const
返回写入结果的节点 ID。
另请参阅 setNodeId()。
void QOpcUaWriteResult::setAttribute(QOpcUa::NodeAttribute attribute)
将写入结果的属性设置为attribute 。
另请参阅 attribute()。
void QOpcUaWriteResult::setIndexRange(const QString &indexRange)
将写入结果的索引范围设置为indexRange 。
另请参阅 indexRange()。
void QOpcUaWriteResult::setNodeId(const QString &nodeId)
将写入结果的节点 ID 设置为nodeId 。
另请参阅 nodeId()。
void QOpcUaWriteResult::setStatusCode(QOpcUa::UaStatusCode statusCode)
将写入结果的状态码设置为statusCode 。
另请参阅 statusCode()。
QOpcUa::UaStatusCode QOpcUaWriteResult::statusCode() const
返回写入结果的状态码。
另请参阅 setStatusCode()。
QOpcUaWriteResult &QOpcUaWriteResult::operator=(const QOpcUaWriteResult &rhs)
将rhs 中的值设置为该写入结果中的值。
© 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.