QMqttMessage Class▲
-
Header: QMqttMessage
-
qmake: QT += mqtt
Detailed Description▲
An MQTT message is created inside the module and returned via the QMqttSubscription::messageReceived() signal.
Property Documentation▲
[read-only] duplicate : const bool▲
This property holds whether the message is a duplicate.
Duplicate messages indicate that the message has been sent earlier, but it has not been confirmed yet. Hence, the broker assumes that it needs to resend to verify the transport of the message itself. Duplicate messages can only occur if the QoS level is one or two.
Access functions:
-
bool duplicate() const
[read-only] id : const quint16▲
This property holds the ID of the message.
IDs are used for messages with a QoS level above zero.
Access functions:
-
id() const
[read-only] payload : const QByteArray▲
This property holds the payload of a message.
Access functions:
-
const &payload() const
[read-only] qos : const quint8▲
This property holds the QoS level of a message.
Access functions:
-
qos() const
[read-only] retain : const bool▲
This property holds whether the message has been retained.
A retained message is kept on the broker for future clients to subscribe. Consequently, a retained message has been created previously and is not a live update. A broker can store only one retained message per topic.
Access functions:
-
bool retain() const
[read-only] topic : const QMqttTopicName▲
This property holds the topic of a message.
In case a wildcard has been used for a subscription, describes the topic matching this subscription. This property never contains wildcards.
Access functions:
-
QMqttTopicName topic() const
Member Function Documentation▲
QMqttMessage::QMqttMessage()▲
Creates a new MQTT message.
QMqttMessage::QMqttMessage(const QMqttMessage &other)▲
Constructs a new MQTT message that is a copy of other.
[since 5.12] int QMqttMessage::publishProperties() const▲
Returns the publish properties received as part of the message.
This function only specifies the properties when a publish message is received. Messages with a QoS value of 1 or 2 can contain additional properties when a message is released. Those can be obtained by the QMqttClient::messageStatusChanged signal.
This function will only provide valid data when the client specifies https:// as https://.
This function was introduced in Qt 5.12.
bool QMqttMessage::operator!=(const QMqttMessage &other) const▲
Returns true if the message and other are not equal, otherwise returns false.
QMqttMessage &QMqttMessage::operator=(const QMqttMessage &other)▲
Makes this object a copy of other and returns the new value of this object.
bool QMqttMessage::operator==(const QMqttMessage &other) const▲
Returns true if the message and other are equal, otherwise returns false.


