Subfolders in my project in Qt Creator?
I have built a Qt Project in Carbide. I have divided all my source files into different folders to get everything more sorted and organized. So for example I have one file in src/things/MyThing.h. So in my pro file I use the following: "HEADERS += src/things/MyThing.h". If I want to include MyThing.h in another file I can just write: #include "MyThing.h". This I can do even if the other file is not in the same folder as MyThing.h. Perfect in Carbide! :-)
Now in Qt Creator this isn't working at all. It seems like I need to have all my sources in the same folder. Is there a work around for this or do I need to move all my files to the same folder?
Thanks!
Re: Subfolders in my project in Qt Creator?
[QUOTE=stegemann;739483]I have built a Qt Project in Carbide. I have divided all my source files into different folders to get everything more sorted and organized. So for example I have one file in src/things/MyThing.h. So in my pro file I use the following: "HEADERS += src/things/MyThing.h". If I want to include MyThing.h in another file I can just write: #include "MyThing.h". This I can do even if the other file is not in the same folder as MyThing.h. Perfect in Carbide! :-)
Now in Qt Creator this isn't working at all. It seems like I need to have all my sources in the same folder. Is there a work around for this or do I need to move all my files to the same folder?
Thanks![/QUOTE]
You should mention all directories in INCLUDEPATH in .pro file
[url]http://doc.trolltech.com/4.6/qmake-variable-reference.html#includepath[/url]
Re: Subfolders in my project in Qt Creator?
Correct, either INCLUDEPATH or DEPENDPATH will be your friend.
[url]http://doc.trolltech.com/4.6/qmake-variable-reference.html#dependpath[/url]