QOpcUaHistoryEvent Class
该类存储节点的历史事件。更多
Header: | #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) |
详细描述
在处理读取历史事件的请求时,该类的实例用于存储有关已读取的节点、其事件和状态代码的信息。历史读取响应的完成信号将返回一个 QOpcUaHistoryEvent 对象列表,可对其进行解析以查看请求结果。
成员函数文档
QOpcUaHistoryEvent::QOpcUaHistoryEvent()
构造一个无效的历史事件项。
[explicit]
QOpcUaHistoryEvent::QOpcUaHistoryEvent(const QString &nodeId)
构建一个历史事件项,并存储其对应的节点。
QOpcUaHistoryEvent::QOpcUaHistoryEvent(const QOpcUaHistoryEvent &other)
从other 中构造一个历史事件项。
[noexcept]
QOpcUaHistoryEvent::QOpcUaHistoryEvent(QOpcUaHistoryEvent &&other)
移动-从other 构建一个新的历史事件对象。
注: moved-from 对象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
。
© 2025 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.