6.0.0-rc4Source

QDBusMetaType Class

The QDBusMetaType class allows you to register types for use with D-Bus. More…

Header#include <QDBusMetaType>
CMaketarget_link_libraries(app PRIVATE Nt::DBus)
ModuleNt D-Bus C++ Classes

List of all members, including inherited members

Public Types

Static Public Members

voidregisterMarshallOperators(QMetaType metaType, MarshallFunction marshall, DemarshallFunction demarshall)
boolmarshall(QDBusArgument &argument, QMetaType metaType, const void *data)
booldemarshall(const QDBusArgument &argument, QMetaType metaType, void *data)
QMetaTypesignatureToMetaType(const char *signature)
const char *typeToSignature(QMetaType metaType)

Detailed Description

The basic D-Bus types, QStringList, QByteArray, QVariantList, QVariantMap and lists of the numbers and of QDBusObjectPath are known from the start. Register other types with qDBusRegisterMetaType():

qDBusRegisterMetaType<Fix>();
qDBusRegisterMetaType<QList<Fix>>();

See also QDBusArgument.

Differences from Qt

None.

Member Type Documentation

typedef QDBusMetaType::DemarshallFunction

The type of a function that reads a value from a QDBusArgument to the given address.

typedef QDBusMetaType::MarshallFunction

The type of a function that writes the value at the given address to a QDBusArgument.

Member Function Documentation

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

Reads a value of the type metaType from argument into data, which must hold a constructed value of that type. Returns false if the type is not registered.

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

Writes the value of the type metaType at data to argument. Returns false if the type is not registered.

[static] void QDBusMetaType::registerMarshallOperators(QMetaType metaType, MarshallFunction marshall, DemarshallFunction demarshall)

Registers marshall and demarshall as the functions that write and read values of the type metaType. qDBusRegisterMetaType() calls this function.

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

Returns the meta-type that values with the D-Bus signature are read into: the basic types and the types registered with QDBusMetaType, or QDBusArgument for any other valid single type. Returns an invalid QMetaType if signature is not a single complete type.

[static] const char * QDBusMetaType::typeToSignature(QMetaType metaType)

Returns the D-Bus signature of values of the type metaType, or nullptr if the type is not known to the D-Bus type system.