En esta página

QMqttLastWillProperties Class

La clase QMqttLastWillProperties representa las opciones de configuración que un « QMqttClient » puede enviar al servidor al especificar la última voluntad al conectarse a un servidor. Más información...

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

Funciones públicas

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

Descripción detallada

Nota: Las propiedadesde «Last Will» forman parte de la especificación MQTT 5.0 y no se pueden utilizar al conectarse con un nivel de protocolo inferior. Consulte QMqttClient::ProtocolVersion para obtener más información.

Documentación de las funciones de los miembros

QString QMqttLastWillProperties::contentType() const

Devuelve el tipo de contenido del mensaje del testamento.

Véase también ` setContentType()`.

QByteArray QMqttLastWillProperties::correlationData() const

Devuelve los datos de correlación para identificar la solicitud.

Véase también setCorrelationData().

quint32 QMqttLastWillProperties::messageExpiryInterval() const

Devuelve la duración del último mensaje «will» en segundos, a partir del intervalo de retardo de «will».

Véase también setMessageExpiryInterval().

QMqtt::PayloadFormatIndicator QMqttLastWillProperties::payloadFormatIndicator() const

Devuelve el indicador del formato de la carga útil.

Véase también setPayloadFormatIndicator().

QString QMqttLastWillProperties::responseTopic() const

Devuelve el tema al que deben responder los suscriptores del mensaje «last will».

Véase también setResponseTopic().

void QMqttLastWillProperties::setContentType(const QString &content)

Establece el tipo de contenido en content.

Véase también contentType().

void QMqttLastWillProperties::setCorrelationData(const QByteArray &correlation)

Establece los datos de correlación en correlation.

Véase también correlationData().

void QMqttLastWillProperties::setMessageExpiryInterval(quint32 expiry)

Establece el intervalo de caducidad de los mensajes en expiry.

Véase también messageExpiryInterval().

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

Establece el indicador de formato de la carga útil en « p ».

Véase también payloadFormatIndicator().

void QMqttLastWillProperties::setResponseTopic(const QString &response)

Establece el tema de respuesta en « response ».

Véase también responseTopic().

void QMqttLastWillProperties::setUserProperties(const QMqttUserProperties &properties)

Establece las propiedades del usuario en properties.

Véase también userProperties().

void QMqttLastWillProperties::setWillDelayInterval(quint32 delay)

Establece el intervalo de retardo en delay.

Véase también willDelayInterval().

QMqttUserProperties QMqttLastWillProperties::userProperties() const

Devuelve las propiedades del usuario.

Véase también setUserProperties().

quint32 QMqttLastWillProperties::willDelayInterval() const

Devuelve el retraso, en segundos, con el que se enviará un mensaje de última voluntad tras desconectarse del servidor.

Véase también setWillDelayInterval().

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