QOpcUaHistoryEvent Class
该类用于存储来自某个节点的历史事件。更多内容...
| 头文件: | #include <QOpcUaHistoryEvent> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
| qmake: | QT += opcua |
| 自: | Qt 6.7 |
公共函数
| QOpcUaHistoryEvent() | |
| QOpcUaHistoryEvent(const QString &nodeId) | |
| QOpcUaHistoryEvent(const QOpcUaHistoryEvent &other) | |
| QOpcUaHistoryEvent(QOpcUaHistoryEvent &&other) | |
| ~QOpcUaHistoryEvent() | |
| void | addEvent(const QVariantList &value) |
| int | count() const |
| QList<QVariantList> | events() const |
| QString | nodeId() const |
| void | setNodeId(const QString &nodeId) |
| void | setStatusCode(QOpcUa::UaStatusCode statusCode) |
| QOpcUa::UaStatusCode | statusCode() const |
| void | swap(QOpcUaHistoryEvent &other) |
| QOpcUaHistoryEvent & | operator=(QOpcUaHistoryEvent &&other) |
| QOpcUaHistoryEvent & | operator=(const QOpcUaHistoryEvent &other) |
相关的非成员
| bool | operator!=(const QOpcUaHistoryEvent &lhs, const QOpcUaHistoryEvent &rhs) |
| bool | operator==(const QOpcUaHistoryEvent &lhs, const QOpcUaHistoryEvent &rhs) |
详细说明
在处理读取历史事件的请求时,该类的实例用于存储已读取的节点、其事件以及状态码的相关信息。历史读取响应的 finished 信号将返回一个 QOpcUaHistoryEvent 对象列表,该列表可被解析以查看请求的结果。
成员函数文档
QOpcUaHistoryEvent::QOpcUaHistoryEvent()
构建了一个无效的历史事件条目。
[explicit] QOpcUaHistoryEvent::QOpcUaHistoryEvent(const QString &nodeId)
创建一个历史事件条目,并记录其对应的节点。
QOpcUaHistoryEvent::QOpcUaHistoryEvent(const QOpcUaHistoryEvent &other)
根据other 构建一个历史事件条目。
[constexpr noexcept default] QOpcUaHistoryEvent::QOpcUaHistoryEvent(QOpcUaHistoryEvent &&other)
从other 创建一个新的历史事件对象。
注意: 被移动的源对象 other 将处于部分形成状态,在此状态下,唯一有效的操作是销毁和赋值。
[noexcept] QOpcUaHistoryEvent::~QOpcUaHistoryEvent()
删除历史事件项。
void QOpcUaHistoryEvent::addEvent(const QVariantList &value)
添加由 `value` 指定的事件字段列表。
int QOpcUaHistoryEvent::count() const
返回可用事件的数量。
QList<QVariantList> QOpcUaHistoryEvent::events() const
返回包含历史记录读取请求结果的QVariantList 对象列表。
QString QOpcUaHistoryEvent::nodeId() const
返回已存储其事件的节点的 nodeId。
另请参阅 setNodeId()。
void QOpcUaHistoryEvent::setNodeId(const QString &nodeId)
将nodeId 设置为nodeId 。
另请参阅 nodeId()。
void QOpcUaHistoryEvent::setStatusCode(QOpcUa::UaStatusCode statusCode)
将状态码设置为statusCode 。
另请参阅 statusCode()。
QOpcUa::UaStatusCode QOpcUaHistoryEvent::statusCode() const
返回一个状态码,用于指示在获取历史事件时是否发生错误。
另请参阅 setStatusCode()。
[noexcept] void QOpcUaHistoryEvent::swap(QOpcUaHistoryEvent &other)
将历史事件对象other 与该历史事件对象进行交换。此操作速度极快,且绝不会失败。
[noexcept] QOpcUaHistoryEvent &QOpcUaHistoryEvent::operator=(QOpcUaHistoryEvent &&other)
将other 通过移动赋值操作赋值给此QOpcUaHistoryEvent 实例。
注意: 被移动的对象 other 将处于部分初始化状态,在此状态下,唯一有效的操作是销毁或赋予新值。
QOpcUaHistoryEvent &QOpcUaHistoryEvent::operator=(const QOpcUaHistoryEvent &other)
将other 中的值设置到此历史事件项中。
相关非成员
[noexcept] bool operator!=(const QOpcUaHistoryEvent &lhs, const QOpcUaHistoryEvent &rhs)
如果 `lhs ` 不等于 `rhs`,则返回 `true `。
[noexcept] bool operator==(const QOpcUaHistoryEvent &lhs, const QOpcUaHistoryEvent &rhs)
如果 `rhs ` 和 `lhs ` 包含相同的值,则返回 `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.