QDBusVariant¶
The QDBusVariant
class enables the programmer to identify the variant type provided by the D-Bus typesystem. More…
Synopsis¶
Functions¶
def
__eq__
(v2)def
setVariant
(variant)def
swap
(other)def
variant
()
Detailed Description¶
A D-Bus function that takes an integer, a D-Bus variant and a string as parameters can be called with the following argument list (see setArguments()
):
arguments = QList() arguments << QVariant(42) << QVariant.fromValue(QDBusVariant(43)) << QVariant("hello") myDBusMessage.setArguments(arguments)
When a D-Bus function returns a D-Bus variant, it can be retrieved as follows:
# call a D-Bus function that returns a D-Bus variant v = callMyDBusFunction() # retrieve the D-Bus variant dbusVariant = qvariant_cast<QDBusVariant>(v) # retrieve the actual value stored in the D-Bus variant result = dbusVariant.variant()
The QVariant
within a QDBusVariant
is required to distinguish between a normal D-Bus value and a value within a D-Bus variant.
See also
- class PySide6.QtDBus.QDBusVariant¶
PySide6.QtDBus.QDBusVariant(v)
PySide6.QtDBus.QDBusVariant(variant)
- Parameters
v – object
variant – object
Constructs a new D-Bus variant.
Constructs a new D-Bus variant from the given Qt variant
.
See also
- PySide6.QtDBus.QDBusVariant.__eq__(v2)¶
- Parameters
- Return type
bool
- PySide6.QtDBus.QDBusVariant.setVariant(variant)¶
- Parameters
variant – object
Assigns the value of the given Qt variant
to this D-Bus variant.
See also
- PySide6.QtDBus.QDBusVariant.swap(other)¶
- Parameters
other –
PySide6.QtDBus.QDBusVariant
Swaps this QDBusVariant
instance with other
.
- PySide6.QtDBus.QDBusVariant.variant()¶
- Return type
object
Returns this D-Bus variant as a QVariant
object.
See also
© 2022 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.