I've now started to dabble with QT and I was wondering if there was a way to get QT creator to automatically add variables to the project file. For example, I usually use C++11 code so it would be nice if QT could put CONFIG += c++11 in the .pro file automatically when I start a new project. I looked around in the options but I can't make sense of some sections so maybe it's right in front of my face?
1 Answers
0
votes
You can edit the wizard files of Qt Creator. The files are in the following directory:
Qt-Dir/Tools/QtCreator/share/qtcreator/templates/wizards/
If you look at the directory there are some folders related to different wizards. For example if you look in to the "plaincppapp/qmake" folder, there you can see a "project.pro" file which is a template pro file. You can just edit that file like:
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
CONFIG += C++11 #added this line
SOURCES += main.cpp
Next time you create a project by that wizard, your custom pro would be created for the project.
\Tools\QtCreator\share\qtcreator\templates
– Sebastian Lange$HOME$/Qt5.2.1/Qt Creator.app/Contents/Resources/templates
– Kuba hasn't forgotten Monicatemplates\wizards
folder. There are many examples there. The readme file tells you how to change the .xml file names to have them recognized by Qt Creator (after a restart). You can, pretty much, create your own wizards, it seems. – Kuba hasn't forgotten Monica