本页内容

QMqttStringPair Class

QMqttStringPair 类表示 MQTT 5.0 标准中的字符串对数据类型。更多内容...

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

公共函数

QString name() const
void setName(const QString &n)
void setValue(const QString &v)
QString value() const
bool operator!=(const QMqttStringPair &other) const
bool operator==(const QMqttStringPair &other) const

详细说明

此数据类型用于存储名称-值对。

成员函数文档

QString QMqttStringPair::name() const

返回字符串对的名称。

另请参阅 setName()。

void QMqttStringPair::setName(const QString &n)

将名称设置为n 。

另请参阅 name()。

void QMqttStringPair::setValue(const QString &v)

将值设置为v 。

另请参阅 value()。

QString QMqttStringPair::value() const

返回字符串对的值。

另请参阅 ` setValue()`。

bool QMqttStringPair::operator!=(const QMqttStringPair &other) const

如果该实例与 `other` 不匹配,则返回 `true `。

bool QMqttStringPair::operator==(const QMqttStringPair &other) const

如果该实例与 `other` 匹配,则返回 `true `。

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