From be714154fa3f9dd7f1a44952293eee037793e383 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 9 Sep 2020 13:42:25 +0200 Subject: Use a hash to store the DBus marshalling data A QList where int is the metaType id is a bad idea in Qt 6, as custom types will start at index 65536. Use a QHash instead. Also fix the API to use QMetaType as arguments and return values. Change-Id: Ia0b894126271be1f01dc4593b5155fb75d713720 Reviewed-by: Thiago Macieira --- src/dbus/qdbusmetatype.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/dbus/qdbusmetatype.h') diff --git a/src/dbus/qdbusmetatype.h b/src/dbus/qdbusmetatype.h index 2b4d056e85..4898db3080 100644 --- a/src/dbus/qdbusmetatype.h +++ b/src/dbus/qdbusmetatype.h @@ -59,8 +59,12 @@ public: static bool marshall(QDBusArgument &, QMetaType id, const void *data); static bool demarshall(const QDBusArgument &, QMetaType id, void *data); - static int signatureToType(const char *signature); - static const char *typeToSignature(int type); + static QMetaType signatureToMetaType(const char *signature); + static int signatureToType(const char *signature) + { return signatureToMetaType(signature).id(); } + static const char *typeToSignature(int type) + { return typeToSignature(QMetaType(type)); } + static const char *typeToSignature(QMetaType type); }; template -- cgit v1.2.3