QMqttLastWillProperties Class

The QMqttLastWillProperties class represents configuration options a QMqttClient can pass to the server when specifying the last will during connecting to a server. 更多...

头: #include <QMqttLastWillProperties>
CMake: find_package(Qt6 REQUIRED COMPONENTS Mqtt)
target_link_libraries(mytarget PRIVATE Qt6::Mqtt)
qmake: QT += mqtt

公共函数

QString contentType () const
QByteArray correlationData () const
quint32 messageExpiryInterval () const
QMqtt::PayloadFormatIndicator payloadFormatIndicator () const
QString responseTopic () const
void setContentType (const QString & content )
void setCorrelationData (const QByteArray & correlation )
void setMessageExpiryInterval (quint32 expiry )
void setPayloadFormatIndicator (QMqtt::PayloadFormatIndicator p )
void setResponseTopic (const QString & response )
void setUserProperties (const QMqttUserProperties & properties )
void setWillDelayInterval (quint32 delay )
QMqttUserProperties userProperties () const
quint32 willDelayInterval () const

详细描述

注意: Last Will properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See QMqttClient::ProtocolVersion 了解更多信息。

成员函数文档编制

QString QMqttLastWillProperties:: contentType () const

Returns the content type of the last will message.

另请参阅 setContentType ().

QByteArray QMqttLastWillProperties:: correlationData () const

Returns the correlation data to identify the request.

另请参阅 setCorrelationData ().

quint32 QMqttLastWillProperties:: messageExpiryInterval () const

Returns the lifetime of the last will message in seconds, starting from the will delay interval.

另请参阅 setMessageExpiryInterval ().

QMqtt::PayloadFormatIndicator QMqttLastWillProperties:: payloadFormatIndicator () const

Returns the payload format indicator.

另请参阅 setPayloadFormatIndicator ().

QString QMqttLastWillProperties:: responseTopic () const

Returns the topic that subscribers to the last will message should respond to.

另请参阅 setResponseTopic ().

void QMqttLastWillProperties:: setContentType (const QString & content )

Sets the content type to content .

另请参阅 contentType ().

void QMqttLastWillProperties:: setCorrelationData (const QByteArray & correlation )

Sets the correlation data to correlation .

另请参阅 correlationData ().

void QMqttLastWillProperties:: setMessageExpiryInterval ( quint32 expiry )

Sets the message expiry interval to expiry .

另请参阅 messageExpiryInterval ().

void QMqttLastWillProperties:: setPayloadFormatIndicator ( QMqtt::PayloadFormatIndicator p )

Sets the payload format indicator to p .

另请参阅 payloadFormatIndicator ().

void QMqttLastWillProperties:: setResponseTopic (const QString & response )

Sets the response topic to response .

另请参阅 responseTopic ().

void QMqttLastWillProperties:: setUserProperties (const QMqttUserProperties & properties )

Sets the user properties to properties .

另请参阅 userProperties ().

void QMqttLastWillProperties:: setWillDelayInterval ( quint32 delay )

Sets the will delay interval to delay .

另请参阅 willDelayInterval ().

QMqttUserProperties QMqttLastWillProperties:: userProperties () const

Returns the user properties.

另请参阅 setUserProperties ().

quint32 QMqttLastWillProperties:: willDelayInterval () const

Returns the delay in seconds a last will message will be sent after disconnecting from the server.

另请参阅 setWillDelayInterval ().