[Solved] QtCreator: How to generate a Qt .pro files that open other project?



  • Hi alls!

    This is just my little curious. Thing is everytimes I open my project trees, I would need to browse into each of my project files's locations.

    I know there must be a way so that when I open one .pro files, QtCreator will open all my other .pro files for me. But I just don't know where to look.

    If you could give me a code example or some wiki link related, it will be highly appreciated!

    Thanks!



  • Go to File > Session Manager... and create a session for your project.

    You can then use File > Session to switch between various sessions. QtCreator will automatically open all previously opened projects and files.

    Make sure you've ticked File > Session Manager... > Restore last session on startup to open the last session automatically (where you've 'left' your work) once QtCreator starts.



  • So the only way to make this happen is to use Session setting?

    Since I change dev environment often to test my work, so whenever I install creator, I will need to set another session for that one...



  • You could group your project into a SUBDIRS project, or you could look into using the include() statement in your .pro file.



  • I tried include() in a test.pro file like this:

    @
    include ("path/to/1.pro")
    include ("path/to/2.pro")
    @

    But when I opened it, QtCreator only open path to that project in a tree, but not actually open the other project.

    Tried SUBDIRS, but QtCreator only open and show the test.pro..

    Could you give me some simple example?

    Much appreciated!



  • They won't be opened as separate projects, no. They will be opened as sub projects in the first case, and as included files in the second. For really opening them as separate projects, you'll really have to resort to using sessions.



  • Thanks everyone, guess I will have to stick with sessions.

    Case solved!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.