diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-09-09 13:42:25 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-09-23 19:30:22 +0200 |
commit | be714154fa3f9dd7f1a44952293eee037793e383 (patch) | |
tree | d6c7cb975de694ef5c8e03b9485893582347e367 /src/dbus/qdbusmetatype.h | |
parent | d39bd9e258a5bb45f6209d892ed682809623807d (diff) |
Use a hash to store the DBus marshalling data
A QList<int> 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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbusmetatype.h')
-rw-r--r-- | src/dbus/qdbusmetatype.h | 8 |
1 files changed, 6 insertions, 2 deletions
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<typename T> |