aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqml.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-12-03 01:11:42 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-01-18 12:51:38 +0100
commit5f76fabd0609f2a61b1ca53d88b6b76bb38e919a (patch)
tree604b1edcb9d690528a114c030cf8ddf5d93f746c /src/qml/qml/qqml.cpp
parent26a97ace7cb9491a325f400b019d40f9413f0a68 (diff)
Move propertyCache- and metaObject-related functions into QQmlMetaType
That's where the data resides. This allows us to lock the mutex only once for all those methods, and it makes a large number of engine pointers unnecessary. Finally, we can now find the element type of a QQmlListProperty without supplying an engine. Change-Id: If1ae8eafe8762a112d1ca06f9c92ab8a727d1bda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqml.cpp')
-rw-r--r--src/qml/qml/qqml.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/qml/qml/qqml.cpp b/src/qml/qml/qqml.cpp
index 59922be564..98eb7e40c3 100644
--- a/src/qml/qml/qqml.cpp
+++ b/src/qml/qml/qqml.cpp
@@ -869,12 +869,8 @@ static bool initObjectLookup(
const QMetaObject *typeMetaObject = type.metaObject();
const QMetaObject *foundMetaObject = propType.metaObject();
- if (!foundMetaObject) {
- if (QQmlEngine *engine = aotContext->qmlEngine()) {
- foundMetaObject = QQmlEnginePrivate::get(engine)->metaObjectForType(
- propType).metaObject();
- }
- }
+ if (!foundMetaObject)
+ foundMetaObject = QQmlMetaType::metaObjectForType(propType).metaObject();
while (foundMetaObject) {
if (foundMetaObject == typeMetaObject)
@@ -1318,7 +1314,8 @@ bool AOTCompiledContext::loadTypeLookup(uint index, void *target) const
->compilationUnit()->typeIds.id;
}
- *static_cast<const QMetaObject **>(target) = ep->metaObjectForType(metaType).metaObject();
+ *static_cast<const QMetaObject **>(target)
+ = QQmlMetaType::metaObjectForType(metaType).metaObject();
return true;
}