QmlJS: Fix resolving of implicit dependencies

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 <henning.gruendl@qt.io>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
This commit is contained in:
Thomas Hartmann
2020-12-02 18:55:37 +01:00
parent 08a1117c26
commit 3838bb4e08

View File

@@ -492,8 +492,11 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc,
for (const auto &toImport : libraryInfo.imports()) { for (const auto &toImport : libraryInfo.imports()) {
QString importName = toImport.module; QString importName = toImport.module;
ComponentVersion vNow = toImport.version; ComponentVersion vNow = toImport.version;
// there was a period in which no version == auto, should we add || !vNow.isValid() to the if? /* There was a period in which no version == auto
if (toImport.flags & QmlDirParser::Import::Auto) * Required for QtQuick imports less than 2.15
*/
if ((toImport.flags & QmlDirParser::Import::Auto)
|| !vNow.isValid())
vNow = version; vNow = version;
Import subImport; Import subImport;
subImport.valid = true; subImport.valid = true;