The QMqttSubscriptionProperties class represents configuration options a QMqttClient can pass to the server when subscribing to a topic filter. 更多...
头: | #include <QMqttSubscriptionProperties> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS Mqtt)
target_link_libraries(mytarget PRIVATE Qt6::Mqtt) |
qmake: | QT += mqtt |
bool | noLocal () const |
void | setNoLocal (bool noloc ) |
void | setSubscriptionIdentifier (quint32 id ) |
void | setUserProperties (const QMqttUserProperties & user ) |
quint32 | subscriptionIdentifier () const |
QMqttUserProperties | userProperties () const |
注意: Subscription properties are part of the MQTT 5.0 specification and cannot be used when connecting with a lower protocol level. See QMqttClient::ProtocolVersion 了解更多信息。
[since 6.4]
bool
QMqttSubscriptionProperties::
noLocal
() const
Returns true if the subscription shall not receive local messages on the same topic.
该函数在 Qt 6.4 引入。
另请参阅 setNoLocal ().
[since 6.4]
void
QMqttSubscriptionProperties::
setNoLocal
(
bool
noloc
)
Sets the subscription option to not receive local message. When a client publishes a message with the same topic as an existing local subscription the server by default sends the message back to the client. If noloc is set to true the broker will not send any message the same client has published.
该函数在 Qt 6.4 引入。
另请参阅 noLocal ().
Sets the subscription identifier to id .
另请参阅 subscriptionIdentifier ().
Sets the user properties to user .
另请参阅 userProperties ().
Returns the subscription identifier used to describe this subscription.
另请参阅 setSubscriptionIdentifier ().
Returns the user specified properties.
另请参阅 setUserProperties ().