QDBusVariant Class Reference [QtDBus module]
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus typesystem. Далее...
#include <QDBusVariant> Inherits QVariant (private).
Класс был добавлен в Qt 4.2.
Открытые функции
- 41 public functions inherited from QVariant
Дополнительные унаследованные члены
- 3 static public members inherited from QVariant
Подробное описание
The QDBusVariant class enables the programmer to identify the variant type provided by the D-Bus typesystem.
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 QDBusMessage::setArguments()):
QList<QVariant> arguments;
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:
QVariant v = callMyDBusFunction();
QDBusVariant dbusVariant = qvariant_cast<QDBusVariant>(v);
QVariant 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 The QtDBus type system.
Описание функций-членов
QDBusVariant::QDBusVariant ()
Constructs a new D-Bus variant.
QDBusVariant::QDBusVariant ( const QVariant & variant )
Constructs a new D-Bus variant from the given Qt variant.
See also setVariant().
void QDBusVariant::setVariant ( const QVariant & variant )
Assigns the value of the given Qt variant to this D-Bus variant.
See also variant().
QVariant QDBusVariant::variant () const
Returns this D-Bus variant as a QVariant object.
See also setVariant().
|