How to create a subdirectory for a project QtCreator?

gruszczy picture gruszczy · Jul 24, 2009 · Viewed 64.7k times · Source

I would like to divide my Qt project into several directories because it is growing pretty large. However, when I click on browse in QtCreator, there is no 'Add directory' and no such thing in 'Add new'. Can this be done somehow?

Answer

Nick picture Nick · Jul 24, 2009

One method you could use is to add a project include file for each sub directory.

Qt Creator displays these in the GUI in a nested fashion, and allows you to add files to them.

e.g.

in project.pro

include(folder1/include.pri)

in folder1/include.pri

HEADERS += MyClass.h
SOURCES += MyClass.cpp

etc