本页内容

QMqttUserProperties Class

QMqttUserProperties 类表示一组可传递给服务器的QMqttStringPair 值。更多内容...

头文件: #include <QMqttUserProperties>
CMake: find_package(Qt6 REQUIRED COMPONENTS Mqtt)
target_link_libraries(mytarget PRIVATE Qt6::Mqtt)
qmake: QT += mqtt
继承自: QList

详细描述

用户属性允许客户端向服务器或其他订阅者传递不属于消息有效载荷的额外数据。

另一方面,它也为服务器提供了向已连接客户端提供更多信息的灵活性。

服务器可能会在已提供的用户属性基础上添加其他属性。但在传输过程中,已提供属性的顺序不会发生改变。

注意:用户 属性是 MQTT 5.0 规范的一部分,在使用QtMqtt 且协议级别较旧时无法使用。有关更多信息,请参阅QMqttClient::ProtocolVersion 。

另请参阅 QMqttAuthenticationProperties 、QMqttConnectionProperties 、QMqttLastWillProperties 、QMqttPublishProperties 、QMqttSubscriptionProperties 、QMqttUnsubscriptionProperties 以及QMqttSubscription 。

© 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.