PySide6.QtMqtt.QMqttTopicName¶
- class QMqttTopicName¶
- The - QMqttTopicNameclass represents a MQTT topic name. More…- Synopsis¶- Methods¶- def - __init__()
- def - isValid()
- def - levelCount()
- def - levels()
- def - name()
- def - __ne__()
- def - setName()
- def - swap()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- QMqttTopicNameis 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,- QMqttTopicNameprovides convenient functions related to topic names like- isValid()or- levels().- See also - __init__(name)¶
- Parameters:
- name – - QLatin1String
 
 - Creates a new MQTT topic name with the specified - name.- __init__(name)
- Parameters:
- name – - QMqttTopicName
 
 - Creates a new MQTT topic name as a copy of - name.- __init__([name=""])
- Parameters:
- name – str 
 
 - Creates a new MQTT topic name with the specified - name.- isValid()¶
- Return type:
- bool 
 
 - Returns - trueif the topic name is valid according to the MQTT standard section 4.7, or- falseotherwise.- levelCount()¶
- Return type:
- int 
 
 - Returns the total number of topic levels. - levels()¶
- Return type:
- list of strings 
 
 - Returns the topic levels. - name()¶
- Return type:
- str 
 
 - Returns the topic name. - See also - __ne__(rhs)¶
- Parameters:
- rhs – - QMqttTopicName
- Return type:
- bool 
 
 - Returns - trueif the topic names- lhsand- rhsare different, otherwise returns- false.- setName(name)¶
- Parameters:
- name – str 
 
 - Sets the topic name to - name.- See also - swap(other)¶
- Parameters:
- other – - QMqttTopicName
 
 - Swaps the MQTT topic name - otherwith this MQTT topic name. This operation is very fast and never fails.