PDA

View Full Version : Grouping files



Jeffb
12th June 2010, 02:54
Hi guys

I'm used to using XCode on Mac which allows you to add folders to the project to group particular files together according to their purpose.

As far as I can see Qt only has the Headers and Sources folders.

Is it at all possible to add other folders and if not, how does anyone keep track of all their files.

Thanks
Jeff

wysota
12th June 2010, 08:40
HEADERS and SOURCES are not folders, they are variables. You can have as many other variables as you wish and you can add contents of one variable to another variable.

MYFILES = a b c
SOURCES += d e f
SOURCES += $$MYFILES

Jeffb
15th June 2010, 05:48
Hi Wysota

If I do something along the lines of the above code in my project file, although it does show a b and c in the SOURCES variable, it still only shows HEADERS and SOURCES in the project tree and doesn't show MYFILES. Is there something else I have to do to get the MYFILES variable showing up in the project tree.

Thanks
Jeff

wysota
15th June 2010, 09:37
I guess you are talking about Qt Creator - a slight "detail" which you forgot to mention. Creator will only show headers and sources but it will show directory names containing files groupped under respective sections of the project. It will also show .pri files as separate groups - if you wish such groupping, you can use one of those mechanisms.

Jeffb
15th June 2010, 10:29
Thanks Wysota

Sorry about leaving out the detail.