How can I create my own default .pro file?



  • 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
    @


  • Moderators

    Take a look into <qt creator dir>/share/qtcreator/templates. I have not tried that myself, but it should be possible to change templates there and it will be reflected in QtC (possibly even without recompilation).



  • Thanks a lot.
    in /usr/share/qtcreator/templates/wizards/ I changed the plaincppapp template and it worked. But I could not find the Qt Gui Application template. There are a lot of templates there, do you know which one is the Qt Gui Application template?


  • Moderators

    I've tried searching too, but could not find it. If you have enough willpower, search Qt Creator source code. I vaguely recall that some templates are hardcoded into the binary. You can change them in source and then compile Qt Creator yourself (it's not hard, just a plain qmake/ make build. Takes about one third of the time Qt itself needs to compile).



  • Thanks alot for your help.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.