QMake: Fix duplicate qrc content items in vcxproj
The Visual Studio generator adds every file that a .qrc depends on
to the "Resource Files" filter. If such a file is also a source or
header of the project, it ended up as both ClCompile (or ClInclude)
and None item, and Visual Studio refuses to load the project with
"is included as ClCompile and as None".
Only add the .qrc dependencies that no other filter lists yet.
Compare the paths case-insensitively, like MSBuild does, so that
"Main.cpp" in the .qrc matches "main.cpp" in SOURCES.
Fixes: QTBUG-77454
Pick-to: 6.12
Change-Id: I454a6df2112b3b17fa4b54962bafddae180a5b56
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| commit | d12bf6f164de250ac3cbb77439dbaf0b2badf8aa |
| parent | f067a7402a6b58ed474d59342911fa56fb5f7191 |
| author | Joerg Bornemann <joerg.bornemann@qt.io> |
| committer | Joerg Bornemann <joerg.bornemann@qt.io> |
| commit time | Wed, 21 Oct 2026 21:24:34 +0000 |
- M qmake/generators/win32/msvc_vcproj.cpp
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/data.txt
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/h.h
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/helper.cpp
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/main.cpp
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/qrc_content.pro
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/res.qrc
- A tests/auto/tools/qmake/testdata/vcxproj_qrc_content/sub/deep.cpp
- M tests/auto/tools/qmake/tst_qmake.cpp