From 92ebe65589ac0e173d297817b07704b2b6f897ee Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 17 Feb 2021 10:30:28 +0100 Subject: Fix lookup of existing inline components by name Previously this would always return the inline component iwth ID 1. Change-Id: I49dc6eb64fcd8428667f3b22afcb7212aa792db3 Reviewed-by: Fabian Kosmale (cherry picked from commit 7104a3a6f8fe518bd8a0d0d246c0f65df340ee38) Reviewed-by: Qt Cherry-pick Bot --- src/qml/qml/qqmlimport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index 4e6a4a8928..d473706172 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -756,7 +756,7 @@ bool QQmlImportInstance::resolveType(QQmlTypeLoader *typeLoader, const QHashedSt if (containingType.isValid()) { // we currently cannot reference a Singleton inside itself // in that case, containingType is still invalid - if (int icID = containingType.lookupInlineComponentIdByName(typeStr) != -1) { + if (int icID = containingType.lookupInlineComponentIdByName(typeStr); icID != -1) { *type_return = containingType.lookupInlineComponentById(icID); } else { auto icType = createICType(); -- cgit v1.2.3