aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cmakeprojectmanager
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2024-04-18 14:29:48 +0200
committerCristian Adam <cristian.adam@qt.io>2024-04-18 13:14:17 +0000
commitc0dfb3ce57482e5630e28364692d2ba89a871a51 (patch)
tree6c6425d8fa3f0b08c76e90d1c6d6a3b67dcbf9a1 /src/plugins/cmakeprojectmanager
parentc3c37b10624aecd39da6b6101d7aaee6fd535527 (diff)
CMakePM: Hide QML clutter project files
Hide some of the QML files that we not marked as generated by the Qt QML CMake code Fixes: QTCREATORBUG-29631 Change-Id: I01fb571c0c3ff7d8a3861ddaaf7c6d6817c8cc51 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r--src/plugins/cmakeprojectmanager/fileapidataextractor.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp
index c2a3e5804a..cfe17d19d4 100644
--- a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp
+++ b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp
@@ -684,6 +684,22 @@ static void addCompileGroups(ProjectNode *targetRoot,
if (isPchFile(buildDirectory, sourcePath) || isUnityFile(buildDirectory, sourcePath))
node->setIsGenerated(true);
+ // Hide some of the QML files that we not marked as generated by the Qt QML CMake code
+ const bool buildDirQmldirOrRcc = sourcePath.isChildOf(buildDirectory)
+ && (sourcePath.parentDir().fileName() == ".rcc"
+ || sourcePath.fileName() == "qmldir");
+ const bool otherDirQmldirOrMetatypes = !sourcePath.isChildOf(buildDirectory)
+ && !sourcePath.isChildOf(sourceDirectory)
+ && (sourcePath.parentDir().fileName() == "metatypes"
+ || sourcePath.fileName() == "qmldir");
+ const bool buildDirPluginCpp = sourcePath.isChildOf(buildDirectory)
+ && td.type.endsWith("_LIBRARY")
+ && sourcePath.fileName().startsWith(td.name)
+ && sourcePath.fileName().endsWith("Plugin.cpp");
+
+ if (buildDirQmldirOrRcc || otherDirQmldirOrMetatypes || buildDirPluginCpp)
+ node->setIsGenerated(true);
+
const bool showSourceFolders = settings().showSourceSubFolders()
&& sourcesOrHeadersFolder(td.sourceGroups[si.sourceGroup]);