Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Custom C++ settings and shared configurations
QtWS25 Last Chance

Custom C++ settings and shared configurations

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 4.0k Views
  • 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.
  • P Offline
    P Offline
    prsolucoes
    wrote on last edited by
    #1

    Hi.

    I created a custom C++ project that have a custom build commands and some environment variables.

    This project is hosted on my git repository.

    The problem is when i checkout in my other PC. When i open the project (flyforcoins.creator), it ask me to load an existing .user file "flyforcoins.creator.user" and i say "YES". But when i click on "Projects" menu in QtCreator, all configs are default and my .user file now is moved to other file "flyforcoins.creator.user.1d2g4g".

    What i have to do to make all the configurations shared?

    Thanks!

    1 Reply Last reply
    0
    • P Offline
      P Offline
      prsolucoes
      wrote on last edited by
      #2

      please, help me :(

      1 Reply Last reply
      0
      • Chris KawaC Online
        Chris KawaC Online
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        I haven't used that myself, but it seems you should create a .pro.share file (edited copy of a .pro.user) and store that in a repository instead of the local .pro.user file.

        Some info on it is "here":https://qt-project.org/doc/qtcreator-2.6/creator-sharing-project-settings.html
        It actually says it's for sharing settings between projects, but I guess it should work for a "single project with multiple users" scenario too.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          prsolucoes
          wrote on last edited by
          #4

          Hi.

          I do it now. I follow the steps in my PC:

          1 - I have closed the project in QtCreator
          2 - I have copied: flyforcoins.creator.user to flyforcoins.creator.shared
          3 - I have deleted file: flyforcoins.creator.user
          4 - I have commited all to git and push
          5 - I open the project on my PC and the settings are correct and a new flyforcoins.creator.user was created based on shared (is true that it is based on .shared file because i have tested open the project without it and the configuration are lost).

          So, in my PC i only need the .shared file. Very nice.

          Now in my other pc:

          1 - I have deleted all and made a new "git clone ...."
          2 - I see in the project path that only the .shared file is there
          3 - I open the project "flyforcoins.creator"
          4 - The configurations was lost :(
          5 - A new .user file was created

          So, dont work. Only work on my PC?

          My project is a custom c++ project - or a Import Project from QtCreator.

          1 Reply Last reply
          0
          • Chris KawaC Online
            Chris KawaC Online
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hmm, sorry but you might be "out of luck":http://stackoverflow.com/questions/13994495/how-to-specify-build-deployment-and-run-configuration-in-a-qt-creator-pro-sh

            It seems the problem is that the .user (or .shared) file holds IDs of the kits, compilers etc. which is not shareable and thus any related information is lost. In that SO question Tobias Hunger said it might work with identical environment on those shared systems but I guess this is unmaintainable in a long run so you will have to look for other solutions.

            Some of the configuration stuff can be moved portably to the .pro file. you might also run some external scripts this way. You can dig through "qmake docs":http://qt-project.org/doc/qt-4.8/qmake-manual.html to see what is possible.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              prsolucoes
              wrote on last edited by
              #6

              Hi.

              Thanks for answer.

              But my two PCs are the same.

                • I have two macbook pro (the exact model).
                • Both use the same OSX 10.8.3.
                • Both use the same kit (in my case the kit is Desktop(default)).

              Dont have any difference in kits, in the macbook pro, nothing :(

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

                You should not put .user files into your version control system. The file is specific to one instance of creator and can not be shared.

                What you can do is put the text editor settings, etc. into a .shared file. Putting the actual build configurations there will not work as the kits and tool chains are identified by GUIDs and he Qt versions have a integer id that is specific to one instance of creator as well. The name of the kit, etc. does not matter to creator (except to display it to the user).

                You could try to move your environment variables and special commands into the build system properly to avoid the need for the special setup.

                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