diff options
author | Thomas Hartmann <[email protected]> | 2024-06-20 09:53:20 +0200 |
---|---|---|
committer | Tim Jenssen <[email protected]> | 2024-06-20 09:48:04 +0000 |
commit | cfc606d91eb1a7ec7f9be8643b6fca4865bd59cf (patch) | |
tree | 3569262466db111ddee6b36f33d7325081438d6f | |
parent | 9ef82deb625fb1d927f90def442b6d914581e6f5 (diff) |
QmlJS: Skip QtQuick3D for implicit importsqds/v4.5.1qds/4.5
The way we resolve implicit imports creates random issues.
QtQuick3D.MaterialEditor implicitly imports QtQuick3D.
If QtQuick3D.MaterialEditor is scanned before QtQuick3D the types
of QtQuick3D are added to QtQuick3D.MaterialEditor and when later
QtQuick3D is scanned no type is added to QtQuick3D because of the cache
in ::createObjectsForImport.
The result is that QtQuick3D does not contain its types and prototypes
cannot be resolved. This does happen roughly 50% of the time and
is the reported issue.
In case QtQuick3D is scanned, first things work, but no "extra types" types are added to QtQuick3D.MaterialEditor.
To keep the patch minimal we simply skip this specific case.
QtQuick importing QtQml implicitly is not touched.
Task-number: QDS-11069
Change-Id: I74088b12a2e737a8a7467068c10a78c4be2a7bda
Reviewed-by: Miikka Heikkinen <[email protected]>
(cherry picked from commit f92ea99107172a2adc067e5d4756d36f73c93965)
Reviewed-by: Tim Jenssen <[email protected]>
-rw-r--r-- | src/libs/qmljs/qmljslink.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libs/qmljs/qmljslink.cpp b/src/libs/qmljs/qmljslink.cpp index 97c00e1c8d9..40198809be7 100644 --- a/src/libs/qmljs/qmljslink.cpp +++ b/src/libs/qmljs/qmljslink.cpp @@ -512,6 +512,16 @@ bool LinkPrivate::importLibrary(const Document::Ptr &doc, // commands in qmldir files, and is pending removal in Qt 6. for (const auto &toImport : libraryInfo.imports()) { QString importName = toImport.module; + + // These implicit imports do not work reliable, since each type + // is only added to one import/module. If a type is added here, + // it is not added to the actual module, because of caching. + // + // In case of QtQuick3D.MaterialEditor this leads to a reproducible issue. + // As a workaround we simply skip all implicit imports for QtQuick3D. + if (importName == "QtQuick3D") + continue; + ComponentVersion vNow = toImport.version; /* There was a period in which no version == auto * Required for QtQuick imports less than 2.15 |