Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. [Solved] Organizing source files
Forum Updated to NodeBB v4.3 + New Features

[Solved] Organizing source files

Scheduled Pinned Locked Moved Qt Creator and other tools
13 Posts 2 Posters 18.2k 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.
  • D Offline
    D Offline
    DarkRoast
    wrote on last edited by
    #1

    Hi all

    I am wondering how I can make folders in Qt creator... I have a lot of .cpp and .h files and and I want to organize them in folders i.e every thing in my Resource layer should be in a folder named Resource, folder called Business for the files belonging to the business layer etc.

    something like this:

    Headers
    - Business
    business.h
    - Resource
    resource.h
    - Views
    viewa.h
    - ...

    Sources
    - Business
    business.cpp
    - Resource
    resource.cpp
    - Views
    viewa.cpp
    - ...

    How can I do this ? Am I that blind that I cant find a solution for this ?

    Is there a plugin which allows me to right click on fx the Sources folder and -> new -> folder ?

    BR
    DarkRoast

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      take a look at how the Qt SDK sources are organized

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DarkRoast
        wrote on last edited by
        #3

        [quote author="chetankjain" date="1298725888"]take a look at how the Qt SDK sources are organized[/quote]

        Maybe I haven't been clear or I am misunderstanding your post. In Visual Studio It is really easy to make folders in your project and organize your source code in those folders...

        At the moment Qt creator only separates the headers, sources and resources files into folders. I want to make my own folders i.e Business folder and put my business code there and etc.

        chetankjain can you show an example on how to do this ?

        BR
        DarkRoast

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          ah apologies, I misunderstood your question. I thought you were seeking information on how to organize sources into subfolders in your project and so asked you to look into the Qt sources organization.

          what you seek is probably not going to be addressed by the creator team .. take a look at these:
          "http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3265":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3265
          "http://bugreports.qt.nokia.com/browse/QTCREATORBUG-902":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-902

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DarkRoast
            wrote on last edited by
            #5

            [quote author="chetankjain" date="1298728689"]
            what you seek is probably not going to be addressed by the creator team .. take a look at these:
            "http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3265":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-3265
            "http://bugreports.qt.nokia.com/browse/QTCREATORBUG-902":http://bugreports.qt.nokia.com/browse/QTCREATORBUG-902
            [/quote]

            Hmmm dt answers like this:

            bq. We aren't a file browser.

            and

            bq. We don't believe that adding file system actions to the project tree is the right place. The project tree doesn't show a 1:1 mapping to the file system and as such is not really suited for that. E.g. you wouldn't see a newly created dir in the project structure.

            I really disagree... I want to create folders in my project tree in Qt creator and organize my source files, just like in visual studio. i.e I want to create a folder called fx. views and then I should bee able to right click on that and create a new class, .cpp or .h and these files will be in the views folder. And of course Qt creator would also create the folder and etc. in the project folder and update the .pro file so everything would compile...

            I find this a very basic feature which helps allot in keeping large projects with many source files organized.

            Its very hard to find files you need, when you only have a folder for the sources and headers. It gets very frustrating when you have 50+ .cpp and .h files...

            How do people using Qt creator manage all their source file in large projects ?

            BR
            DarkRoast

            1 Reply Last reply
            0
            • ? This user is from outside of this forum
              ? This user is from outside of this forum
              Guest
              wrote on last edited by
              #6

              good points DarkRoast, and having used various IDE's over time myself, I understand what you mean.
              Unfortunately there is no "Postponed" state or the likes in Qt bug tracker and I find many times bugs are closed as "out of scope at present".
              You could try to reopen the above bugs and vote for it. Other interested developers could also vote for its priority and if sufficient votes are there, who knows it might just get taken up. Or someone from community could contribute ...

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DarkRoast
                wrote on last edited by
                #7

                I really like working in Qt creator, its a very good IDE. But it really bugs me that Qt creator does not have this basic feature...

                1 Reply Last reply
                0
                • ? This user is from outside of this forum
                  ? This user is from outside of this forum
                  Guest
                  wrote on last edited by
                  #8

                  I work only with Qt creator for coding in Qt :) and it is evolving continuously which is good

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DarkRoast
                    wrote on last edited by
                    #9

                    [quote author="chetankjain" date="1298732843"]I work only with Qt creator for coding in Qt :) and it is evolving continuously which is good[/quote]

                    I wonder how much Qtcreator evolving is going on now in the Qt department ...? Now when Nokia has sold its soul to Microsoft.

                    1 Reply Last reply
                    0
                    • ? This user is from outside of this forum
                      ? This user is from outside of this forum
                      Guest
                      wrote on last edited by
                      #10

                      there have been many varying blog posts and comments on this topic ... but as far as I know, no announcement made so far about ramping down efforts on Qt. And its just a partnership with MS and not a sale :) ... so I'm not really worried about Qt dying. There is also the community to further support Qt under any circumstance

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        tobias.hunger
                        wrote on last edited by
                        #11

                        The project viewer is meant to visualize the project structure, not the locations in a file system. It is not a file system browser. Feel free to use that instead if you want to see your files grouped by location in the filesystem.

                        If you are using qmake to build your sources you can structure the project tree by introducing .pri files. The project viewer does group files based on which pro/pri file they belong to. Visualizing the project structure is what it is supposed to do after all.

                        Just open Qt Creator's pro file for an example on how that looks.

                        I basically do all my navigation by using the F2, F4 and Ctrl-K key combos. Especially the last one (locator) is really powerful and gets me to classes, methods, files, etc. without having to bother about where the code is located in the filesystem/project structure.

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          DarkRoast
                          wrote on last edited by
                          #12

                          Thank you very much Tobias!

                          .pri files do exactly what I need :) This is what I did:

                          .pro:
                          @.
                          .
                          .
                          include(Business.pri)
                          .@

                          The .pri file:

                          @INCLUPATH += Business # Creates the folder Business in project tree

                          SOURCES += business.cpp \ # Creates a folder Sources in the Business folder

                          HEADERS += business.h # Creates a folder Headers in the business folder @

                          This way I can organize and sort my .cpp an .h files :)

                          Thanks!
                          DarkRoast

                          1 Reply Last reply
                          0
                          • ? This user is from outside of this forum
                            ? This user is from outside of this forum
                            Guest
                            wrote on last edited by
                            #13

                            you should've looked at how the Qt sources are organized to find it out by yourself :)
                            Tobias is our Creator Guru :D

                            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