Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How can I create my own default .pro file?
Forum Updated to NodeBB v4.3 + New Features

How can I create my own default .pro file?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    akrep55tr
    wrote on last edited by
    #1

    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
    @

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      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).

      (Z(:^

      1 Reply Last reply
      0
      • A Offline
        A Offline
        akrep55tr
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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).

          (Z(:^

          1 Reply Last reply
          0
          • A Offline
            A Offline
            akrep55tr
            wrote on last edited by
            #5

            Thanks alot for your help.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved