From 7a9a778604a03473b6c4ef8a481ba3cc06d48265 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 5 Jan 2024 14:08:32 +0100 Subject: QtQml: Remove QQmlTypeLoader from QQmlImport The type loader belongs to the engine and we must not store it in engine-independent data structures. We do want the import cache to be stored in the type registry, though (in a separate change). Change-Id: I2828f5098b27bf1fc96852fc2bd160db44b109e7 Reviewed-by: Fabian Kosmale --- src/qml/types/qqmlbind.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/qml/types/qqmlbind.cpp') diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp index cb2da29c10..1386c3ae39 100644 --- a/src/qml/types/qqmlbind.cpp +++ b/src/qml/types/qqmlbind.cpp @@ -780,14 +780,16 @@ void QQmlBindPrivate::decodeBinding( Q_ASSERT(typeReference); QQmlType attachedType = typeReference->type(); if (!attachedType.isValid()) { - const QQmlTypeNameCache::Result result - = deferredData->context->imports()->query(propertySuffix); - if (!result.isValid()) { - qmlWarning(q).nospace() - << "Unknown name " << propertySuffix << ". The binding is ignored."; - return; + if (QQmlTypeLoader *typeLoader = compilationUnit->engine->typeLoader()) { + const QQmlTypeNameCache::Result result + = deferredData->context->imports()->query(propertySuffix, typeLoader); + if (!result.isValid()) { + qmlWarning(q).nospace() + << "Unknown name " << propertySuffix << ". The binding is ignored."; + return; + } + attachedType = result.type; } - attachedType = result.type; } QQmlContext *context = qmlContext(q); -- cgit v1.2.3