Skip to main content

Qt Creator Tipps

I really dig Qt Creator (though my first euphoric stance has already relativated itself a little).

but because the IDE still is somewhat of an underdog, help in the net is somewhat rare.

therefore i decided to give a short summary about how one can setup some important settings for custom makefile projects. (they also might come in handy for all other people using the IDE).
all my descriptions are based on my qt creator IDE version 1.2.1 used under ubuntu 9.04.
i am pretty sure some posted points will save people out there some time.


*) getting your source files into your project
your project will contain a .files file. open it up and put inside all additional files you want to have.
example:
your project is located in
/home/f/sources/testApp/
and you want to have a file included in
/home/f/sources/CommonSourcecode/foo.cpp
Then add
./CommonSourcecode/foo.cpp
to .files and create a symbolic link in
/home/f/sources/testApp/
pointing to
/home/f/sources/CommonSourcecode/

done!

*) setting up include directories
your project will contain a .includes file. open it up and put inside all additional paths that you want discovered. one example entry would be
/home/f/sources/Includes

*) using scons with qt creator
using scons is easy. Press STRG + 4 to go to the projects view. choose the project, then in the build settings, choose build steps. under "override" put in the word "scons".

done!
*) setting up the debugger for your custom makefile project
Press STRG + 4 to go to the projects view. choose the project, then in the "Run Settings". Press the plus, add a name, with "browse" choose the already-built executeable you want to debug.

done!
*) get your qt creator to display #define correctly
do you have a preprocessor macro inside your code that qt creator greys out although it shouldnt? put all those #defines you want qt creator to know inside the .config file.
by example if you want it to not grey out
#ifdef _DEBUG
foo = bar;
#endif
then add
#define _DEBUG
to your .config file.

done!


hope some points are helpful to you.

happy coding!

Comments