QOpcUaDataValue Class
该类用于存储 OPC UA 值数据及相关的元数据。更多内容...
| 头文件: | #include <QOpcUaDataValue> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
| qmake: | QT += opcua |
| 鉴于: | Qt 6.3 |
公共函数
| QOpcUaDataValue() | |
| QOpcUaDataValue(const QOpcUaDataValue &other) | |
| ~QOpcUaDataValue() | |
(since 6.7) quint16 | serverPicoseconds() const |
| QDateTime | serverTimestamp() const |
(since 6.7) void | setServerPicoseconds(quint16 serverPicoseconds) |
| void | setServerTimestamp(const QDateTime &serverTimestamp) |
(since 6.7) void | setSourcePicoseconds(quint16 sourcePicoseconds) |
| void | setSourceTimestamp(const QDateTime &sourceTimestamp) |
| void | setStatusCode(QOpcUa::UaStatusCode statusCode) |
| void | setValue(const QVariant &value) |
(since 6.7) quint16 | sourcePicoseconds() const |
| QDateTime | sourceTimestamp() const |
| QOpcUa::UaStatusCode | statusCode() const |
| void | swap(QOpcUaDataValue &other) |
| QVariant | value() const |
(since 6.7) | operator QVariant() const |
| QOpcUaDataValue & | operator=(const QOpcUaDataValue &other) |
相关的非成员
(since 6.7) bool | operator!=(const QOpcUaDataValue &lhs, const QOpcUaDataValue &rhs) |
(since 6.7) bool | operator==(const QOpcUaDataValue &lhs, const QOpcUaDataValue &rhs) |
成员函数文档
QOpcUaDataValue::QOpcUaDataValue()
构建一个无效的数据值。
QOpcUaDataValue::QOpcUaDataValue(const QOpcUaDataValue &other)
根据other 构建一个数据值。
[noexcept] QOpcUaDataValue::~QOpcUaDataValue()
销毁数据值。
[since 6.7] quint16 QOpcUaDataValue::serverPicoseconds() const
返回服务器时间戳包含的10皮秒时间间隔的数量。
该函数于 Qt 6.7 中引入。
另请参阅 setServerPicoseconds()。
QDateTime QOpcUaDataValue::serverTimestamp() const
返回value() 的服务器时间戳。
另请参阅 setServerTimestamp()。
[since 6.7] void QOpcUaDataValue::setServerPicoseconds(quint16 serverPicoseconds)
将服务器时间戳的 10 皮秒间隔数设置为serverPicoseconds 。
该函数自 Qt 6.7 起引入。
另请参阅 serverPicoseconds()。
void QOpcUaDataValue::setServerTimestamp(const QDateTime &serverTimestamp)
将服务器时间戳设置为serverTimestamp 。
另请参阅 serverTimestamp()。
[since 6.7] void QOpcUaDataValue::setSourcePicoseconds(quint16 sourcePicoseconds)
将源时间戳的10皮秒间隔数设置为sourcePicoseconds 。
该函数在 Qt 6.7 中引入。
另请参阅 sourcePicoseconds()。
void QOpcUaDataValue::setSourceTimestamp(const QDateTime &sourceTimestamp)
将源时间戳设置为sourceTimestamp 。
另请参阅 sourceTimestamp()。
void QOpcUaDataValue::setStatusCode(QOpcUa::UaStatusCode statusCode)
将状态码设置为statusCode 。
另请参阅 statusCode()。
void QOpcUaDataValue::setValue(const QVariant &value)
将该值设置为value 。
如果要将此数据值与QOpcUaBinaryDataEncoding 或QOpcUaGenericStructHandler 配合使用,则该值的类型必须为QOpcUaVariant 。
另请参阅 value()。
[since 6.7] quint16 QOpcUaDataValue::sourcePicoseconds() const
返回源时间戳对应的 10 皮秒时间间隔的数量。
该函数于 Qt 6.7 中引入。
另请参阅 setSourcePicoseconds()。
QDateTime QOpcUaDataValue::sourceTimestamp() const
返回value() 的源时间戳。
另请参阅 setSourceTimestamp()。
QOpcUa::UaStatusCode QOpcUaDataValue::statusCode() const
返回此数据值的状态码。如果状态码不是Good ,则该值和时间戳无效。
另请参阅 setStatusCode()。
[noexcept] void QOpcUaDataValue::swap(QOpcUaDataValue &other)
将该数据值实例与other 互换。该函数运行速度极快,且绝不会失败。
QVariant QOpcUaDataValue::value() const
返回该值。
另请参阅 setValue()。
[since 6.7] QOpcUaDataValue::operator QVariant() const
返回一个包含该数据值的QVariant 。
该函数于 Qt 6.7 中引入。
QOpcUaDataValue &QOpcUaDataValue::operator=(const QOpcUaDataValue &other)
将other 中的值设置为此数据值。
相关非成员
[noexcept, since 6.7] bool operator!=(const QOpcUaDataValue &lhs, const QOpcUaDataValue &rhs)
如果 `lhs ` 不等于 `rhs`,则返回 `true `。
该函数在 Qt 6.7 中引入。
[noexcept, since 6.7] bool operator==(const QOpcUaDataValue &lhs, const QOpcUaDataValue &rhs)
如果 `lhs ` 等于 `rhs`,则返回 `true `。
该函数在 Qt 6.7 中引入。
© 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.