2
votes

All my source files are stored in one project (physical) directory. Qt creator shows this files in 3 folders: Headers (for *.hpp and *.h), Sources (for *.cpp and *.c) and Forms (for *.ui). But I would like to have a few another logical folder. For example I would like to create logical folder "protocol" logically containing *.hpp and *.cpp files which maintain network connection and so on. I don't want to create a new folder on my disk for these files. I want only logical one in Qt Creator. Is it possible?

One more reason why I need these logical folders is that I would like to see often used files in one place

2

2 Answers

4
votes

QtCreator 3.0 has QBS support, a build system that will supersede qmake. It has Group of files, which is displayed as a virtual folder.

Anyway, having too much files in one folder is always annoying and a bad practice. By using prefix property of Group you can easily change the path of files.

1
votes

For qmake projects, the only way it's possible, unfortunately, is by tweaking Qt Creator project manager plugin sources.

Remember that Qt Creator doesn't manage any of those files by itself. The file lists are extracted from project file(s) by a project manager plugin. If/when a plugin adds them, they are added to the project file(s).

You're most likely using the qmake project manager. A "simple" way to do it would be to extract the file grouping from variables with a common prefix. Let's say the intersection of each QTC_Foo with union of HEADERS and SOURCES would be displayed in Foo group.

I think it might be simple to implement, so I might come up with a patch later in this answer. The first step for you is downloading and compiling Qt Creator :)