From 3838bb4e0810209106c1846c406c84ba822c4eb8 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 2 Dec 2020 18:55:37 +0100 Subject: [PATCH] QmlJS: Fix resolving of implicit dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the QtQuick import was less than 2.15 implicit dependencies were not properly resolved. For example if a type from a module derives from QtQml.QtObject. Change-Id: I42a3320ee91496da0991de2018efcd124d56f6cd Reviewed-by: Henning Gründl Reviewed-by: Fawzi Mohamed --- src/libs/qmljs/qmljslink.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index cdd60967b76..32e916eb89d 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -492,8 +492,11 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc, for (const auto &toImport : libraryInfo.imports()) { QString importName = toImport.module; ComponentVersion vNow = toImport.version; - // there was a period in which no version == auto, should we add || !vNow.isValid() to the if? - if (toImport.flags & QmlDirParser::Import::Auto) + /* There was a period in which no version == auto + * Required for QtQuick imports less than 2.15 + */ + if ((toImport.flags & QmlDirParser::Import::Auto) + || !vNow.isValid()) vNow = version; Import subImport; subImport.valid = true;