Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.2, 6.9
-
Windows 10 22H2, MSVC 2022 x64
-
f7e29f7d2 (dev), a315e8caa (6.9), f1351ad76 (6.8)
Description
The attached project has this structure:
./ ├── CMakeLists.txt ├── Main.qml ├── main.cpp └── MyLib/ └── CMakeLists.txt qml/ ├── GreenRect.qml └── MyScript.js
It builds fine but fails to run with a weird error message:
QQmlApplicationEngine failed to load component qrc:/qt/qml/MyApp/Main.qml:9:2: Type GreenRect unavailable qrc:/qt/qml/MyLib/qml/GreenRect.qml: "MyLib" is ambiguous. Found in qrc:/qt/qml/MyLib/ and in qrc:/qt/qml/MyLib/
Workarounds
The error disappears if any of the following actions are taken:
- Disable QTP0004
- Move the GreenRect.qml and MyScript.js out of the "qml" subfolder
- Remove MyScript.js from the module
- Don't let GreenRect.qml do "import MyLib"