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
QDBusMetaType Class Reference

\inmodule QtDBus More...

#include <qdbusmetatype.h>

Collaboration diagram for QDBusMetaType:

Public Types

typedef void(* MarshallFunction) (QDBusArgument &, const void *)
typedef void(* DemarshallFunction) (const QDBusArgument &, void *)

Static Public Member Functions

static void registerMarshallOperators (QMetaType typeId, MarshallFunction, DemarshallFunction)
static bool marshall (QDBusArgument &, QMetaType id, const void *data)
static bool demarshall (const QDBusArgument &, QMetaType id, void *data)
static void registerCustomType (QMetaType type, const QByteArray &signature)
static QMetaType signatureToMetaType (const char *signature)
static const char * typeToSignature (QMetaType type)

Detailed Description

\inmodule QtDBus

Meta-type registration system for the Qt D-Bus module.

The QDBusMetaType class allows you to register class types for marshalling and demarshalling over D-Bus. D-Bus supports a very limited set of primitive types, but allows one to extend the type system by creating compound types, such as arrays (lists) and structs. In order to use them with Qt D-Bus, those types must be registered.

See \l {qdbustypesystem.html}{Qt D-Bus Type System} for more information on the type system and how to register additional types.

See also
{qdbustypesystem.html}{Qt D-Bus Type System}, qDBusRegisterMetaType(), QMetaType, QVariant, QDBusArgument

Definition at line 18 of file qdbusmetatype.h.

Member Typedef Documentation

◆ DemarshallFunction

typedef void(* QDBusMetaType::DemarshallFunction) (const QDBusArgument &, void *)

Definition at line 22 of file qdbusmetatype.h.

◆ MarshallFunction

typedef void(* QDBusMetaType::MarshallFunction) (QDBusArgument &, const void *)

Definition at line 21 of file qdbusmetatype.h.

Member Function Documentation

◆ demarshall()

bool QDBusMetaType::demarshall ( const QDBusArgument & arg,
QMetaType metaType,
void * data )
static

Executes the demarshalling of type metaType (whose data will be placed in data) from the D-Bus marshalling argument arg. Returns true if the demarshalling succeeded, or false if an error occurred.

Definition at line 245 of file qdbusmetatype.cpp.

◆ marshall()

bool QDBusMetaType::marshall ( QDBusArgument & arg,
QMetaType metaType,
const void * data )
static

Executes the marshalling of type metaType (whose data is contained in data) to the D-Bus marshalling argument arg. Returns true if the marshalling succeeded, or false if an error occurred.

Definition at line 210 of file qdbusmetatype.cpp.

◆ registerCustomType()

void QDBusMetaType::registerCustomType ( QMetaType type,
const QByteArray & signature )
static

Registers the meta type type to be represeneted by the given D-Bus signature.

This is used in qdbuscpp2xml for custom types which aren't known to the C++ type system.

Definition at line 374 of file qdbusmetatype.cpp.

◆ registerMarshallOperators()

void QDBusMetaType::registerMarshallOperators ( QMetaType metaType,
MarshallFunction mf,
DemarshallFunction df )
static

Registers the marshalling and demarshalling functions for meta type metaType.

Definition at line 187 of file qdbusmetatype.cpp.

◆ signatureToMetaType()

QMetaType QDBusMetaType::signatureToMetaType ( const char * signature)
static

Definition at line 292 of file qdbusmetatype.cpp.

◆ typeToSignature()

const char * QDBusMetaType::typeToSignature ( QMetaType type)
static

Returns the D-Bus signature equivalent to the supplied meta type id type.

More types can be registered with the qDBusRegisterMetaType() function.

See also
QDBusUtil::isValidSingleSignature(), signatureToType(), QVariant::metaType()

Definition at line 397 of file qdbusmetatype.cpp.


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