QMqttTopicName#

The QMqttTopicName class represents a MQTT topic name. More

Inheritance diagram of PySide6.QtMqtt.QMqttTopicName

Synopsis#

Functions#

Detailed Description#

QMqttTopicName is a thin wrapper around a QString providing an expressive data type for MQTT topic names. Beside the benefits of having a strong type preventing unintended misuse, QMqttTopicName provides convenient functions related to topic names like isValid() or levels() .

See also

QMqttTopicFilter

class PySide6.QtMqtt.QMqttTopicName(name)#

PySide6.QtMqtt.QMqttTopicName([name=””])

Parameters

namePySide6.QtMqtt.QMqttTopicName

Creates a new MQTT topic name as a copy of name.

Creates a new MQTT topic name with the specified name.

PySide6.QtMqtt.QMqttTopicName.isValid()#
Return type

bool

Returns true if the topic name is valid according to the MQTT standard section 4.7, or false otherwise.

PySide6.QtMqtt.QMqttTopicName.levelCount()#
Return type

int

Returns the total number of topic levels.

PySide6.QtMqtt.QMqttTopicName.levels()#
Return type

list of strings

Returns the topic levels.

PySide6.QtMqtt.QMqttTopicName.name()#
Return type

str

Returns the topic name.

See also

setName()

PySide6.QtMqtt.QMqttTopicName.__ne__(rhs)#
Parameters

rhsPySide6.QtMqtt.QMqttTopicName

Return type

bool

Returns true if the topic names lhs and rhs are different, otherwise returns false.

PySide6.QtMqtt.QMqttTopicName.setName(name)#
Parameters

name – str

Sets the topic name to name.

See also

name()

PySide6.QtMqtt.QMqttTopicName.swap(other)#
Parameters

otherPySide6.QtMqtt.QMqttTopicName

Swaps the MQTT topic name other with this MQTT topic name. This operation is very fast and never fails.