QDBusVariant Class Reference

Data type for representing a D-Bus variant. More...

#include <qdbusvariant.h>

List of all members.

Public Member Functions

 QDBusVariant ()
 Creates an empty variant object.
 QDBusVariant (const QDBusVariant &other)
 Copies the given other variant object.
bool operator== (const QDBusVariant &other) const
 Checks if the given other variant is equal to this one.
bool operator!= (const QDBusVariant &other) const
 Checks if the given other variant is not equal to this one.

Public Attributes

QString signature
 The D-Bus data signature of the data contained in value.
QDBusData value
 The D-Bus data type to transport as a variant.

Detailed Description

Data type for representing a D-Bus variant.

When D-Bus methods or signal require that a paramater can have any of the D-Bus data types, a D-Bus variant can be used.

Basically a D-Bus variant includes the actual data and a D-Bus data signature to allow a receiver to determine the contents.

Since the QDBusVariant's value member will already be fully de-marshalled, a receiver using this bindings can savely ignore the signature if it doesn't need it for a different purpose (e.g. logging).

However, when creating a QDBusVariant object for sending, make sure the signature member is correctly setup, for example by using the value member's buildDBusSignature() method.

 QDBusVariant variant;

 variant.value     = QDBusData::fromInt32(131719);
 variant.signature = variant.value.buildDBusSignature();

Constructor & Destructor Documentation

QDBusVariant::QDBusVariant (  )  [inline]

Creates an empty variant object.

QDBusVariant::QDBusVariant ( const QDBusVariant other  )  [inline]

Copies the given other variant object.

Parameters:
other the variant object to copy from

References signature, and value.


Member Function Documentation

bool QDBusVariant::operator!= ( const QDBusVariant other  )  const [inline]

Checks if the given other variant is not equal to this one.

Parameters:
other the variant object to compare with
Returns:
true if either signature or value is different, otherwise false

References signature, and value.

bool QDBusVariant::operator== ( const QDBusVariant other  )  const [inline]

Checks if the given other variant is equal to this one.

Parameters:
other the variant object to compare with
Returns:
true if both signature and value are equal, otherwise false

References signature, and value.


Member Data Documentation

The D-Bus data signature of the data contained in value.

See also:
QDBusData::buildDBusSignature()

Referenced by operator!=(), operator==(), and QDBusVariant().

The D-Bus data type to transport as a variant.

Referenced by operator!=(), operator==(), and QDBusVariant().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2