PDA

View Full Version : How can I create my own default .pro file?



akrep55tr
7th March 2013, 08:47
Hi all,
Whenever I open a new project in Qtcreator a default .pro file is created and I want some lines to be added in the begining. Is it possible?

For example this is default .pro file for a new project:

QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui

But I want it tobe like this:

QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui

CONFIG(debug, debug|release) {
debug: DESTDIR =../_Debug/debug-$${VERSION}_Qt-$${QT_VERSION}_$${DATE}
} else {
release: DESTDIR =../_Release/release-$${VERSION}_Qt-$${QT_VERSION}_$${DATE}
}

OBJECTS_DIR = $$DESTDIR/.obj
MOC_DIR = $$DESTDIR/.moc
RCC_DIR = $$DESTDIR/.qrc
UI_DIR = $$DESTDIR/.ui

wysota
7th March 2013, 09:38
For this particular thing I think you'd need to change QtCreator sources and rebuild the IDE. It seems this particular project type wizard is not based on templates.

An alternative is to create your own pri or prf file and simply add a line in the project file to active it.