diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-12-03 01:11:42 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-01-18 12:51:38 +0100 |
commit | 5f76fabd0609f2a61b1ca53d88b6b76bb38e919a (patch) | |
tree | 604b1edcb9d690528a114c030cf8ddf5d93f746c /src/qml/qml/qqmlpropertycachecreator_p.h | |
parent | 26a97ace7cb9491a325f400b019d40f9413f0a68 (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/qqmlpropertycachecreator_p.h')
-rw-r--r-- | src/qml/qml/qqmlpropertycachecreator_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlpropertycachecreator_p.h b/src/qml/qml/qqmlpropertycachecreator_p.h index 635819cfff..2c80db3c91 100644 --- a/src/qml/qml/qqmlpropertycachecreator_p.h +++ b/src/qml/qml/qqmlpropertycachecreator_p.h @@ -81,7 +81,7 @@ struct QQmlBindingInstantiationContext { const QQmlRefPointer<QQmlPropertyCache> &referencingObjectPropertyCache); bool resolveInstantiatingProperty(); - QQmlRefPointer<QQmlPropertyCache> instantiatingPropertyCache(QQmlEnginePrivate *enginePrivate) const; + QQmlRefPointer<QQmlPropertyCache> instantiatingPropertyCache() const; int referencingObjectIndex = -1; const QV4::CompiledData::Binding *instantiatingBinding = nullptr; @@ -92,7 +92,7 @@ struct QQmlBindingInstantiationContext { struct QQmlPendingGroupPropertyBindings : public QVector<QQmlBindingInstantiationContext> { - void resolveMissingPropertyCaches(QQmlEnginePrivate *enginePrivate, QQmlPropertyCacheVector *propertyCaches) const; + void resolveMissingPropertyCaches(QQmlPropertyCacheVector *propertyCaches) const; }; struct QQmlPropertyCacheCreatorBase @@ -383,7 +383,7 @@ template <typename ObjectContainer> inline QQmlRefPointer<QQmlPropertyCache> QQmlPropertyCacheCreator<ObjectContainer>::propertyCacheForObject(const CompiledObject *obj, const QQmlBindingInstantiationContext &context, QQmlError *error) const { if (context.instantiatingProperty) { - return context.instantiatingPropertyCache(enginePrivate); + return context.instantiatingPropertyCache(); } else if (obj->inheritedTypeNameIndex != 0) { auto *typeRef = objectContainer->resolvedType(obj->inheritedTypeNameIndex); Q_ASSERT(typeRef); @@ -967,7 +967,7 @@ inline QQmlError QQmlPropertyCacheAliasCreator<ObjectContainer>::propertyDataFor if (!QQmlMetaType::isValueType(targetProperty->propType()) && valueTypeIndex != -1) { // deep alias property *type = targetProperty->propType(); - QQmlRefPointer<QQmlPropertyCache> typeCache = enginePriv->propertyCacheForType(*type); + QQmlRefPointer<QQmlPropertyCache> typeCache = QQmlMetaType::propertyCacheForType(*type); Q_ASSERT(typeCache); QQmlPropertyData *typeProperty = typeCache->property(valueTypeIndex); |