- class QMqttTopicName¶
The
QMqttTopicName
class 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¶
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 likeisValid()
orlevels()
.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
true
if the topic name is valid according to the MQTT standard section 4.7, orfalse
otherwise.- 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
true
if the topic nameslhs
andrhs
are different, otherwise returnsfalse
.- setName(name)¶
- Parameters:
name – str
Sets the topic name to
name
.See also
- swap(other)¶
- Parameters:
other –
QMqttTopicName
Swaps the MQTT topic name
other
with this MQTT topic name. This operation is very fast and never fails.