Results 1 to 4 of 4

Thread: MSVC Project generated using qmake - turn off flat structure

  1. #1
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy MSVC Project generated using qmake - turn off flat structure

    Hi!
    I've spent realy long time lookig for this. I've quit large project and I would like to define source and header files structure as I want have it in MSVC 2005 project. Finally, I've found CONFIG -= flat option, but it isn't enoug. I want to disable dividing to Header files / Source file filters.

    Example:
    - project structure:
    ProjectDir
    - Group1Dir
    # file1_1.h
    # file1_1.cpp
    # file1_2.h
    # file1_2.cpp
    - Group2Dir
    # file2_1.h
    # file2_1.cpp
    # file2_2.h
    # file2_2.cpp
    - Group3Dir
    etc ...
    - and currently I get this structure in MSVC project
    ProjectName
    - GeneratedFiles
    ...
    - ResourceFiles
    ...
    - HeaderFiles
    - Group1Dir
    # file1_1.h
    # file1_2.h
    - Group2Dir
    ...
    - SourceFiles
    - Group1Dir
    # file1_1.cpp
    # file1_2.cpp
    - Group2Dir
    ...

    I would like to have headers and sources (*.h and *.cpp) together as in real directory structure. Isn't here realy any possibility to turn off automatically creating of Header Files and Source Files filters?

    Thanks a lot!

    PS: I've some experiences with CMake and there is even possible create SOURCE_GROUPS and then it does filters in MSVC project. Because I haven't found nothing similar here, I'm trying to do this using structured project directories and turning off flat option.
    Last edited by Piskvorkar; 12th June 2010 at 13:57.

  2. #2
    Join Date
    Nov 2012
    Posts
    21
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MSVC Project generated using qmake - turn off flat structure

    Can't you just put them all in SOURCES rather than splitting them into SOURCES and HEADERS?

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: MSVC Project generated using qmake - turn off flat structure

    The "SourceFiles" and "HeaderFiles" filters are simply names. They have nothing to do with the underlying structure of the project on the disk, and in fact the project wizards *do* put both ,cpp and .h files in the same directory when you use the "add class" wizard.

    If you don't like the names MSVC chooses for you, change them (right-click on the name in the project tree and rename it). Or just highlight the file names in the tree and drag them to wherever you want them. Nothing is changed on disk when you do this, it just changes the names of the filters or the location of file names within filters in the vcproj file.

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: MSVC Project generated using qmake - turn off flat structure

    simplest thing to do is to change the project file manually.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Project structure with qtestlib
    By matteonardi in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2010, 08:01
  2. Replies: 1
    Last Post: 3rd December 2009, 23:34
  3. Project structure with Qt designer
    By lmax in forum Newbie
    Replies: 1
    Last Post: 12th June 2008, 01:17
  4. help explaining qmake generated make file
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2006, 09:54
  5. Replies: 3
    Last Post: 12th January 2006, 17:41

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.