×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    113

    Qt Creator: Merging Headers & Sources into one folder

    Hey guys,

    I'm working on a large project and having all the Headers and Sources separated in different folders is getting really bothersome. Is there any way to merge those two folders into one?

    Also, is there a quick key combination to move from Implementation to Header and viceversa?

    Thanks!

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Qt Creator: Merging Headers & Sources into one folder

    you can use VPATH in project file
    http://doc.qt.nokia.com/4.6/qmake-va...nce.html#vpath

    Another way is to copy all cpp and h files into the same folder and regenerate the project file.

  3. #3
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    113

    Re: Qt Creator: Merging Headers & Sources into one folder

    Quote Originally Posted by divanov View Post
    you can use VPATH in project file
    http://doc.qt.nokia.com/4.6/qmake-va...nce.html#vpath

    Another way is to copy all cpp and h files into the same folder and regenerate the project file.
    Hey divanov, thank you for your reply!

    Thing is, they are in the same directory... But still Qt Creator shows them separated in two (virtual) folders, Sources and Headers.
    I tried editing the .pro file and placing all the headers under SOURCES and leaving HEADERS empty, but that didn't do the trick, it would start throwing "undefined reference to `vtable for ClassName'" at linking time in all my classes.

    Thanks!

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Qt Creator: Merging Headers & Sources into one folder

    I think all you want to do is to push the button that changes the view from "project" to "file system" or some such.

  5. #5
    Regular Contributor
    Join Date
    Aug 2004
    Posts
    113

    Re: Qt Creator: Merging Headers & Sources into one folder

    Quote Originally Posted by danhicksbyron View Post
    I think all you want to do is to push the button that changes the view from "project" to "file system" or some such.
    Hey! That's actually quite close to what I want, but without a Tree view it becomes a bit unusable, at least for my own taste.

    I guess there is no way to do this..? I wonder why did they do it like this, I may be wrong but most IDEs don't force the programmer to have Implementation and Header separated!

    Thanks anyways!

  6. #6
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Qt Creator: Merging Headers & Sources into one folder

    I wonder why did they do it like this

    Someone's idea of "structured programming", I suppose.

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    17

    Re: Qt Creator: Merging Headers & Sources into one folder

    I like to add a .pri file to each folder , so that they will look like a library. If you include files from other directory in .pro/pri , it look quite ugly as it show the full path name . But my way looks ok.

    p.s F2/Shift + F2 can find the decleration and switch between header and source file.

Similar Threads

  1. Qt Creator code completion not working with Qt Mobility for Symbian
    By ceefour in forum [Archived] Qt Mobility Project
    Replies: 4
    Last Post: 2011-09-10, 05:02
  2. Nokia Qt SDK for Mac -- build fails in Qt Creator
    By ovjo12 in forum [Archived] Qt SDKs and Tools
    Replies: 4
    Last Post: 2010-07-19, 15:29
  3. Replies: 7
    Last Post: 2010-07-14, 14:58
  4. QT Nokia sdk installation and QT Creator config problem
    By kapiluiet in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2010-06-02, 13:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×