QmlCompiler: align import behavior with interpreter
We were preferring QML files over C++-defined types of the same name.
That's wrong. Change the behavior to prefer C++-defined types. qmllint
reported false positive warnings about these, and qmlcachegen rejected
them as ambiguous. They are in fact not ambiguous and we can compile
them.
Pick-to: 6.12
Task-number: QTBUG-150967
Change-Id: I7ae7265b96bb4c04d87143126db8fd98429f193c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| commit | 2f8bba69dd6513f4fe3d861cadae36e578a4b096 |
| parent | 2f77e1033471a28b93b89d7e21cd236876bfba70 |
| author | Ulf Hermann <ulf.hermann@qt.io> |
| committer | Ulf Hermann <ulf.hermann@qt.io> |
| commit time | Mon, 12 Oct 2026 12:28:17 +0000 |
- M src/qmlcompiler/qqmljsimporter.cpp
- M src/qmlcompiler/qqmljslookupsignatures.cpp
- M src/qmlcompiler/qqmljstyperesolver.cpp
- M src/qmlcompiler/qqmljstyperesolver_p.h
- M tests/auto/qml/qmlcppcodegen/CMakeLists.txt
- M tests/auto/qml/qmlcppcodegen/data/CMakeLists.txt
- A tests/auto/qml/qmlcppcodegen/data/CppShadowsQml/CMakeLists.txt
- A tests/auto/qml/qmlcppcodegen/data/CppShadowsQml/Shadowed.qml
- A tests/auto/qml/qmlcppcodegen/data/CppShadowsQml/shadowed.h
- A tests/auto/qml/qmlcppcodegen/data/cppShadowsQml.qml
- M tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen.cpp
- A tests/auto/qml/qmllint/data/CppShadowsQml/Shadowed.qml
- A tests/auto/qml/qmllint/data/CppShadowsQml/plugins.qmltypes
- A tests/auto/qml/qmllint/data/CppShadowsQml/qmldir
- A tests/auto/qml/qmllint/data/cppShadowsQml.qml
- M tests/auto/qml/qmllint/tst_qmllint.cpp