QMqttMessageStatusProperties Class
QMqttMessageStatusProperties 类表示服务器在消息传递过程中提供的附加信息。更多
Header: | #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
返回与信息一起指定的属性。
© 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.