365 qWarning(
"QDBusMarshaller: cannot add an invalid QVariant");
394 qWarning(
"QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " 395 "Use qDBusRegisterMetaType to register it",
402 switch (*signature) {
405 case DBUS_TYPE_INT16:
406 case DBUS_TYPE_UINT16:
407 case DBUS_TYPE_INT32:
408 case DBUS_TYPE_UINT32:
409 case DBUS_TYPE_INT64:
410 case DBUS_TYPE_UINT64:
411 case DBUS_TYPE_DOUBLE:
414 case DBUS_TYPE_BOOLEAN:
419 append( qvariant_cast<uchar>(arg) );
421 case DBUS_TYPE_BOOLEAN:
424 case DBUS_TYPE_INT16:
425 append( qvariant_cast<short>(arg) );
427 case DBUS_TYPE_UINT16:
428 append( qvariant_cast<ushort>(arg) );
430 case DBUS_TYPE_INT32:
433 case DBUS_TYPE_UINT32:
436 case DBUS_TYPE_INT64:
439 case DBUS_TYPE_UINT64:
442 case DBUS_TYPE_DOUBLE:
447 case DBUS_TYPE_STRING:
450 case DBUS_TYPE_OBJECT_PATH:
451 append( qvariant_cast<QDBusObjectPath>(arg) );
453 case DBUS_TYPE_SIGNATURE:
454 append( qvariant_cast<QDBusSignature>(arg) );
458 case DBUS_TYPE_VARIANT:
460 return append( qvariant_cast<QDBusVariant>(arg) );
462 case DBUS_TYPE_ARRAY:
465 switch (arg.
type()) {
479 case DBUS_TYPE_STRUCT:
480 case DBUS_STRUCT_BEGIN_CHAR:
483 case DBUS_TYPE_DICT_ENTRY:
484 case DBUS_DICT_ENTRY_BEGIN_CHAR:
485 qFatal(
"QDBusMarshaller::appendVariantInternal got a DICT_ENTRY!");
490 append(qvariant_cast<QDBusUnixFileDescriptor>(arg));
496 qWarning(
"QDBusMarshaller::appendVariantInternal: Found unknown D-BUS type '%s'",
static QDBusArgumentPrivate * d(QDBusArgument &q)
bool appendCrossMarshalling(QDBusDemarshaller *arg)
void error(const QString &message)
The QDBusArgument class is used to marshall and demarshall D-Bus arguments.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
#define DBUS_TYPE_UNIX_FD
QDBusDemarshaller * demarshaller()
static const char * typeToName(Type type)
Converts the enum representation of the storage type, typ, to its string representation.
static void qIterAppend(DBusMessageIter *it, QByteArray *ba, int type, const void *arg)
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
qlonglong toLongLong(bool *ok=0) const
Returns the variant as a long long int if the variant has type() LongLong , Bool , ByteArray , Char , Double , Int , String , UInt , or ULongLong ; otherwise returns 0.
qulonglong toULongLong(bool *ok=0) const
Returns the variant as as an unsigned long long int if the variant has type() ULongLong ...
Q_CORE_EXPORT void qWarning(const char *,...)
Type
This enum type defines the types of variable that a QVariant can contain.
Q_CORE_EXPORT void qFatal(const char *,...)
int userType() const
Returns the storage type of the value stored in the variant.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Type type() const
Returns the storage type of the value stored in the variant.
const void * constData() const
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
T qvariant_cast(const QVariant &)
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
bool appendRegisteredType(const QVariant &arg)