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. Qt Creator - Relative paths

Qt Creator - Relative paths

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 4 Posters 2.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.
  • S Offline
    S Offline
    stretchthebits
    wrote on last edited by
    #1

    Allo,
    Qt Creator doesn’t seem to be using Relative paths.

    I am on Kubuntu 20.10.
    My account is in
    /home/john
    and my projects are in
    /home/john/qt-workspace/MyProject

    In my project, on the left side, I click on the Projects button. It has a wrench icon on it.
    The build directory is
    /home/john/qt-workspace/MyProject/build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug

    Then, I copied the MyProjects folder to my other profile = Jake
    /home/jake

    When I open Qt Creator, when I open my project
    The build directory is still
    /home/john/qt-workspace/MyProject/build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug
    ^^^^^Notice the john
    This is bad.

    Is this my fault? Did I do something wrong?
    Because if I give this project to others, nobody will be able to compile it since they don’t have a profile named john. Everyone has a different username.

    jsulmJ 1 Reply Last reply
    0
    • S stretchthebits

      Allo,
      Qt Creator doesn’t seem to be using Relative paths.

      I am on Kubuntu 20.10.
      My account is in
      /home/john
      and my projects are in
      /home/john/qt-workspace/MyProject

      In my project, on the left side, I click on the Projects button. It has a wrench icon on it.
      The build directory is
      /home/john/qt-workspace/MyProject/build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug

      Then, I copied the MyProjects folder to my other profile = Jake
      /home/jake

      When I open Qt Creator, when I open my project
      The build directory is still
      /home/john/qt-workspace/MyProject/build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug
      ^^^^^Notice the john
      This is bad.

      Is this my fault? Did I do something wrong?
      Because if I give this project to others, nobody will be able to compile it since they don’t have a profile named john. Everyone has a different username.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @stretchthebits If you copy a Qt project delete the *.pro.user file before opening it in QtCreator.
      You also should not add this file to your code version system.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • S Offline
        S Offline
        stretchthebits
        wrote on last edited by
        #3

        @jsulm said in Qt Creator - Relative paths:

        If you copy a Qt project delete the *.pro.user file before opening it in QtCreator.
        You also should not add this file to your code version system.

        I tried that. Whenever I apply a solution it breaks something else it seems.
        Now, if I open MyProject.pro file with Qt Creator, I get a “Configure Project” page that opens in Qt Creator.
        It wants me to select

        1. Desktop Qt 5.12.2 GCC 64 bit
        2. Desktop Qt 5.14.2 GCC 64 bit
        3. Desktop Qt 5.9.9 GCC 64 bit
          and there are checkboxes that I can click next to those 3 options.
          and there is a Configure Project button at the bottom.

        I click on Configure Project and it recreates the user file.
        Can we keep the user file and have Qt Creator use relative paths?
        That seems to be the proper way to design an IDE.

        JonBJ jsulmJ 2 Replies Last reply
        0
        • S stretchthebits

          @jsulm said in Qt Creator - Relative paths:

          If you copy a Qt project delete the *.pro.user file before opening it in QtCreator.
          You also should not add this file to your code version system.

          I tried that. Whenever I apply a solution it breaks something else it seems.
          Now, if I open MyProject.pro file with Qt Creator, I get a “Configure Project” page that opens in Qt Creator.
          It wants me to select

          1. Desktop Qt 5.12.2 GCC 64 bit
          2. Desktop Qt 5.14.2 GCC 64 bit
          3. Desktop Qt 5.9.9 GCC 64 bit
            and there are checkboxes that I can click next to those 3 options.
            and there is a Configure Project button at the bottom.

          I click on Configure Project and it recreates the user file.
          Can we keep the user file and have Qt Creator use relative paths?
          That seems to be the proper way to design an IDE.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @stretchthebits said in Qt Creator - Relative paths:

          Can we keep the user file and have Qt Creator use relative paths?
          That seems to be the proper way to design an IDE.

          This is a user forum; we're users just like you. Seems to me you're going to have to work as best you can with however it works. I don't know, but most configuration files are text files, maybe you could grep through to spot the old path references and update them if you want to preserve the file?

          S 1 Reply Last reply
          0
          • JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by JoeCFD
            #5

            go to /home/jake/MyProject/build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug and do:
            make distclean to clean this dir up completely or
            simply remove this dir before you launch qt creator
            I think the old Makefile is still there.

            Or before you copy your project over, do make distclean first in or remove build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug
            of course in Release as well.

            I confirmed the Makefile has local info. Therefore, it has to be removed for a new user.

            1 Reply Last reply
            0
            • JonBJ JonB

              @stretchthebits said in Qt Creator - Relative paths:

              Can we keep the user file and have Qt Creator use relative paths?
              That seems to be the proper way to design an IDE.

              This is a user forum; we're users just like you. Seems to me you're going to have to work as best you can with however it works. I don't know, but most configuration files are text files, maybe you could grep through to spot the old path references and update them if you want to preserve the file?

              S Offline
              S Offline
              stretchthebits
              wrote on last edited by
              #6

              @JonB Thanks JonB and JoeCFD.
              Yes, I opened those files and did the change but perhaps it is better to get rid of absolute paths.
              I created a bug report
              https://bugreports.qt.io/browse/QTCREATORBUG-25863

              JonB:
              Yes, the old Makefile was still there since I just transferred all projects to my new user name = jake
              It was just a HDD to HDD copy, so it is fast.

              Yes, you are right. Makefile has absolute paths but that is not really important if I place my project on sourceforge.
              I don’t give them
              build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Debug
              build-MyProject-Desktop_Qt_5_9_9_GCC_64bit-Release

              but technically, Makefile should not contain absolute paths either.

              1 Reply Last reply
              0
              • S stretchthebits

                @jsulm said in Qt Creator - Relative paths:

                If you copy a Qt project delete the *.pro.user file before opening it in QtCreator.
                You also should not add this file to your code version system.

                I tried that. Whenever I apply a solution it breaks something else it seems.
                Now, if I open MyProject.pro file with Qt Creator, I get a “Configure Project” page that opens in Qt Creator.
                It wants me to select

                1. Desktop Qt 5.12.2 GCC 64 bit
                2. Desktop Qt 5.14.2 GCC 64 bit
                3. Desktop Qt 5.9.9 GCC 64 bit
                  and there are checkboxes that I can click next to those 3 options.
                  and there is a Configure Project button at the bottom.

                I click on Configure Project and it recreates the user file.
                Can we keep the user file and have Qt Creator use relative paths?
                That seems to be the proper way to design an IDE.

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @stretchthebits said in Qt Creator - Relative paths:

                Can we keep the user file and have Qt Creator use relative paths?

                Things like build folder or the Kit used to build a project are not part of the project configuration for good reasons. Often different developers with different environments (or even different OS) work on same project. So, why should project configuration contain things that will be likely different for different developers? Maybe developer A uses different Kits than developer B and developer C prefers to have the build folder somewhere else and developer D works on Linux instead of Windows, so the paths are anyway invalid. The pro.user file is not even stored in the version control systems in real projects...
                I already worked on many projects with many other developers and things like these NEVER were stored as part of the project.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                S 1 Reply Last reply
                2
                • jsulmJ jsulm

                  @stretchthebits said in Qt Creator - Relative paths:

                  Can we keep the user file and have Qt Creator use relative paths?

                  Things like build folder or the Kit used to build a project are not part of the project configuration for good reasons. Often different developers with different environments (or even different OS) work on same project. So, why should project configuration contain things that will be likely different for different developers? Maybe developer A uses different Kits than developer B and developer C prefers to have the build folder somewhere else and developer D works on Linux instead of Windows, so the paths are anyway invalid. The pro.user file is not even stored in the version control systems in real projects...
                  I already worked on many projects with many other developers and things like these NEVER were stored as part of the project.

                  S Offline
                  S Offline
                  stretchthebits
                  wrote on last edited by
                  #8

                  @jsulm I see.

                  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