From 5f76fabd0609f2a61b1ca53d88b6b76bb38e919a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 3 Dec 2021 01:11:42 +0100 Subject: 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 --- src/qml/qml/qqmlpropertycachecreator_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/qml/qml/qqmlpropertycachecreator_p.h') 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 &referencingObjectPropertyCache); bool resolveInstantiatingProperty(); - QQmlRefPointer instantiatingPropertyCache(QQmlEnginePrivate *enginePrivate) const; + QQmlRefPointer instantiatingPropertyCache() const; int referencingObjectIndex = -1; const QV4::CompiledData::Binding *instantiatingBinding = nullptr; @@ -92,7 +92,7 @@ struct QQmlBindingInstantiationContext { struct QQmlPendingGroupPropertyBindings : public QVector { - void resolveMissingPropertyCaches(QQmlEnginePrivate *enginePrivate, QQmlPropertyCacheVector *propertyCaches) const; + void resolveMissingPropertyCaches(QQmlPropertyCacheVector *propertyCaches) const; }; struct QQmlPropertyCacheCreatorBase @@ -383,7 +383,7 @@ template inline QQmlRefPointer QQmlPropertyCacheCreator::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::propertyDataFor if (!QQmlMetaType::isValueType(targetProperty->propType()) && valueTypeIndex != -1) { // deep alias property *type = targetProperty->propType(); - QQmlRefPointer typeCache = enginePriv->propertyCacheForType(*type); + QQmlRefPointer typeCache = QQmlMetaType::propertyCacheForType(*type); Q_ASSERT(typeCache); QQmlPropertyData *typeProperty = typeCache->property(valueTypeIndex); -- cgit v1.2.3