diff --git a/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp b/src/plugins/cmakeprojectmanager/fileapidataextractor.cpp index c2a3e5804ab..cfe17d19d46 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]);