QMqttMessageStatusProperties Class
QMqttMessageStatusProperties 类表示服务器在消息传递过程中提供的附加信息。更多内容...
| 头文件: | #include <QMqttMessageStatusProperties> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Mqtt) target_link_libraries(mytarget PRIVATE Qt6::Mqtt) |
| qmake: | QT += mqtt |
公共函数
| QString | reason() const |
| QMqtt::ReasonCode | reasonCode() const |
| QMqttUserProperties | userProperties() const |
详细说明
根据QMqttClient::publish()发送的消息的QoS级别,服务器会报告投递状态。除QMqtt::MessageStatus 外,服务器还可能包含补充信息。这些信息通过QMqttMessageStatusProperties向用户公开。
注意:消息 状态属性是 MQTT 5.0 规范的一部分,在连接较低协议层时无法使用。有关更多信息,请参阅QMqttClient::ProtocolVersion 。
成员函数文档
QString QMqttMessageStatusProperties::reason() const
返回消息投递失败的原因字符串。
QMqtt::ReasonCode QMqttMessageStatusProperties::reasonCode() const
返回消息投递失败的原因代码。
QMqttUserProperties QMqttMessageStatusProperties::userProperties() const
返回与该消息相关联的属性。
© 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.