Results 1 to 6 of 6

Thread: File templates in Qt Creator

  1. #1
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default File templates in Qt Creator

    Is there a way to change the file template Qt Creator uses when creating a new file? I looked around in the options but couldn't find anything.

  2. #2
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: File templates in Qt Creator

    *bump*
    Anyone know the answer to this?

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: File templates in Qt Creator

    have a look at qtsdk-XYZ/share/qtcreator/templates/qt4project there you can edit the template files.

  4. #4
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: File templates in Qt Creator

    I looked in that directory but don't see any templates for default source and header files.
    All I see are:

    main.cpp - template for main source file
    mywidget.cpp - template for widget source
    mywidget.h - template for widget header
    mywidget_form.cpp - template for widget UI form source
    mywidget_form.h - template for widget UI form header
    widget.ui - template for user interface XML file

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: File templates in Qt Creator

    Quote Originally Posted by JovianGhost View Post
    main.cpp - template for main source file
    mywidget.cpp - template for widget source
    mywidget.h - template for widget header
    mywidget_form.cpp - template for widget UI form source
    mywidget_form.h - template for widget UI form header
    widget.ui - template for user interface XML file
    And that are exactely the file you are looking for. Or I havn't get you right. E.g. mywidget.cpp is used if you create a new Qt-C++-Class out of the new-dialog.

    EDIT: Ah, you mean a non Qt C++ class....

  6. #6
    Join Date
    Mar 2010
    Posts
    55
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: File templates in Qt Creator

    Yes, I mean a straight-up C++ header file, i.e. not a widget.

Similar Threads

  1. Qt Creator: File Makefile doesn't exist
    By earthling in forum Qt Tools
    Replies: 6
    Last Post: 4th November 2016, 03:44
  2. Qt Creator: File Makefile doesn't exist
    By earthling in forum Qt Programming
    Replies: 0
    Last Post: 9th December 2009, 17:46
  3. Qt Creator + file templates
    By NoRulez in forum Qt Programming
    Replies: 3
    Last Post: 13th August 2009, 22:57
  4. HELP!!!Qt Creator can not open project file
    By zhouxf in forum Qt Tools
    Replies: 7
    Last Post: 22nd May 2009, 09:56
  5. templates
    By mickey in forum General Programming
    Replies: 5
    Last Post: 16th January 2008, 15:25

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.