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"
Attachments
For Gerrit Dashboard: QTBUG-133587 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
623382,2 | WIP: Do not complain about duplicate scripts when using QTP0004 | dev | qt/qtdeclarative | Status: ABANDONED | -2 | -1 |
623742,8 | QtQml: Clean up qmldir redirection | dev | qt/qtdeclarative | Status: MERGED | +2 | +1 |
627625,3 | QtQml: Clean up qmldir redirection | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
627894,3 | QtQml: Clean up qmldir redirection | 6.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |