aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetatype_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-06-07 15:28:54 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-06-09 14:47:13 +0200
commitc4addf7d0e91cd39b636a88772ae9543f11e2c8c (patch)
treea82c384a019573365ab357767972d5344abed495 /src/qml/qml/qqmlmetatype_p.h
parente5383a5d5dd02afdbe94b380394fd88d8320e35a (diff)
Pass QMetaType by value rather than by ID in more places
This saves us some ping-pong between the IDs and the QMetaTypes, and avoids possible ambiguities if multiple metatypes are registered for the same C++ type. Change-Id: I81cec94a9cd05d69927dc884f65574f0ab2ddc22 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlmetatype_p.h')
-rw-r--r--src/qml/qml/qqmlmetatype_p.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/qml/qml/qqmlmetatype_p.h b/src/qml/qml/qqmlmetatype_p.h
index 7ee16f9dc9..4ea1938051 100644
--- a/src/qml/qml/qqmlmetatype_p.h
+++ b/src/qml/qml/qqmlmetatype_p.h
@@ -164,16 +164,13 @@ public:
static QList<QQmlType> qmlSingletonTypes();
static QList<QQmlType> qmlAllTypes();
- enum class TypeIdCategory {
- MetaType,
- QmlType
- };
-
static QQmlType qmlType(const QString &qualifiedName, QTypeRevision version);
static QQmlType qmlType(const QHashedStringRef &name, const QHashedStringRef &module, QTypeRevision version);
static QQmlType qmlType(const QMetaObject *);
static QQmlType qmlType(const QMetaObject *metaObject, const QHashedStringRef &module, QTypeRevision version);
- static QQmlType qmlType(int typeId, TypeIdCategory category = TypeIdCategory::MetaType);
+ static QQmlType qmlTypeById(int qmlTypeId);
+
+ static QQmlType qmlType(QMetaType metaType);
static QQmlType qmlType(const QUrl &unNormalizedUrl, bool includeNonFileImports = false);
static QQmlPropertyCache *propertyCache(const QMetaObject *metaObject,
@@ -192,8 +189,8 @@ public:
static QMetaType listType(QMetaType type);
static QQmlAttachedPropertiesFunc attachedPropertiesFunc(QQmlEnginePrivate *,
const QMetaObject *);
- static bool isInterface(int);
- static const char *interfaceIId(int);
+ static bool isInterface(QMetaType type);
+ static const char *interfaceIId(QMetaType type);
static bool isList(QMetaType type);
static QTypeRevision latestModuleVersion(const QString &uri);