Results 1 to 5 of 5

Thread: Grouping files

  1. #1
    Join Date
    Apr 2010
    Posts
    77
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Grouping files

    Hi guys

    I'm used to using XCode on Mac which allows you to add folders to the project to group particular files together according to their purpose.

    As far as I can see Qt only has the Headers and Sources folders.

    Is it at all possible to add other folders and if not, how does anyone keep track of all their files.

    Thanks
    Jeff

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Grouping files

    HEADERS and SOURCES are not folders, they are variables. You can have as many other variables as you wish and you can add contents of one variable to another variable.

    qmake Code:
    1. MYFILES = a b c
    2. SOURCES += d e f
    3. SOURCES += $$MYFILES
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Apr 2010
    Posts
    77
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Grouping files

    Hi Wysota

    If I do something along the lines of the above code in my project file, although it does show a b and c in the SOURCES variable, it still only shows HEADERS and SOURCES in the project tree and doesn't show MYFILES. Is there something else I have to do to get the MYFILES variable showing up in the project tree.

    Thanks
    Jeff

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Grouping files

    I guess you are talking about Qt Creator - a slight "detail" which you forgot to mention. Creator will only show headers and sources but it will show directory names containing files groupped under respective sections of the project. It will also show .pri files as separate groups - if you wish such groupping, you can use one of those mechanisms.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2010
    Posts
    77
    Thanks
    10
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Grouping files

    Thanks Wysota

    Sorry about leaving out the detail.

Similar Threads

  1. Replies: 0
    Last Post: 22nd April 2010, 13:18
  2. Replies: 1
    Last Post: 8th April 2010, 19:25
  3. Custom file browser - grouping files
    By chezifresh in forum Qt Programming
    Replies: 3
    Last Post: 21st September 2009, 03:05
  4. Grouping of Tool buttons in Tool bar
    By febil in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2009, 11:51
  5. Grouping Widgets Together
    By joshuajcarson in forum Qt Programming
    Replies: 1
    Last Post: 21st October 2008, 20:17

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.