Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QDBusVariant Class Reference

\inmodule QtDBus More...

#include <qdbusextratypes.h>

Collaboration diagram for QDBusVariant:

Public Member Functions

 QDBusVariant () noexcept
 Constructs a new D-Bus variant.
 QDBusVariant (const QVariant &variant)
 Constructs a new D-Bus variant from the given Qt variant.
 QDBusVariant (QVariant &&v) noexcept
void swap (QDBusVariant &other) noexcept
 \memberswap{variant}
void setVariant (const QVariant &variant)
 Assigns the value of the given Qt variant to this D-Bus variant.
QVariant variant () const
 Returns this D-Bus variant as a QVariant object.

Detailed Description

\inmodule QtDBus

Since
4.2

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()):

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
// retrieve the D-Bus variant
// retrieve the actual value stored in the D-Bus variant
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 Qt D-Bus Type System}

Definition at line 129 of file qdbusextratypes.h.

Constructor & Destructor Documentation

◆ QDBusVariant() [1/3]

QDBusVariant::QDBusVariant ( )
inlinenoexcept

Constructs a new D-Bus variant.

Definition at line 133 of file qdbusextratypes.h.

◆ QDBusVariant() [2/3]

QDBusVariant::QDBusVariant ( const QVariant & variant)
inlineexplicit

Constructs a new D-Bus variant from the given Qt variant.

See also
setVariant()

Definition at line 149 of file qdbusextratypes.h.

References QDBusVariant().

Referenced by QDBusVariant().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ QDBusVariant() [3/3]

QDBusVariant::QDBusVariant ( QVariant && v)
inlineexplicitnoexcept

Definition at line 138 of file qdbusextratypes.h.

Member Function Documentation

◆ setVariant()

void QDBusVariant::setVariant ( const QVariant & variant)
inline

Assigns the value of the given Qt variant to this D-Bus variant.

See also
variant()

Definition at line 152 of file qdbusextratypes.h.

◆ swap()

void QDBusVariant::swap ( QDBusVariant & other)
inlinenoexcept

\memberswap{variant}

Definition at line 140 of file qdbusextratypes.h.

◆ variant()

QVariant QDBusVariant::variant ( ) const
inline

Returns this D-Bus variant as a QVariant object.

See also
setVariant()

Definition at line 144 of file qdbusextratypes.h.


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