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. Old and New projects keep mixing.
Qt 6.11 is out! See what's new in the release blog

Old and New projects keep mixing.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.8k 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.
  • A Offline
    A Offline
    achmed
    wrote on last edited by
    #1

    Hi. I Tried finding an answer on the web, but I'm not exactly sure what I even need to search for.
    Any help will be appreciated...

    MY SETUP:
    I Have a directory where I run my project from.
    This directory contains incremental folders 1,2,3,4... These are the versions/builds as I progress on the project.
    Each time I get to a point where the program compiles with a new improvement I create a new folder and copy the files to the new directory.
    This includes the following:
    build-Contact_Noise-Desktop_Qt_5_3_MinGW_32bit-Debug
    AND
    Contact_Noise

    MY PROBLEM:
    When opening an old version lets say from folder 1, and compile it.
    The MainWindow that appears is that of folder 23 (The latest version).

    WHAT I HAVE TRIED SO FAR:
    I Deleted all files in folder 1 except the source, header and .pro files.
    When opening the project from folder 1 again it configures the project.
    And then runs the correct MainWindow from it's own folder.
    But now the opposite happens again.
    When running the latest version from folder 23 after doing the above, the MainWindow is that of the old project in folder 1, and not from its own folder 23.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      This happens because the a GUI file (something like "ui_mainwindow.h") gets generated in build-Contact_Noise-Desktop_Qt_5_3_MinGW_32bit-Debug. One solution is to clean your build before you recompile (In Qt Creator: Click "Build" -> "Clean Project" ... or just delete build-Contact_Noise-Desktop_Qt_5_3_MinGW_32bit-Debug )

      But anyway, may I suggest a better way of backing up? Instead of copying your project folder, use a proper version control system. "Git":http://www.sourcetreeapp.com/ is quite popular. Using Git to backup your project will avoid the problem you described, and it also lets you see the exact changes you've made across different versions.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • A Offline
        A Offline
        achmed
        wrote on last edited by
        #3

        Thanks. I will look into Git. Looks quite nice.
        Cleaning the project does seem to work.
        Although I'm a bit puzzled.
        If the GUI file gets generated in build-Contact_Noise-Desktop_Qt_5_3_MinGW_32bit-Debug.
        And the build-Contact_Noise-Desktop_Qt_5_3_MinGW_32bit-Debug folder is unique to each incremented folder.
        How do the two get mixed up.

        Example: If I open the project version 1. Then it should use the data stored in the build-Contact_Noise-Desktop_Qt_5_3_MinGW_32bit-Debug folder 1 and not that of folder 23. Why does this happen or am I misunderstanding something here?

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          Actually, I just remembered: The absolute path of your build folder is hard-coded into your configuration file. Open your *.pro.user file with a text editor and look inside.

          Even after you move/rename your project files, your configuration file will still point to the old location. Thus, the build system will still build into the old location, unless you reconfigure your project. You can erase the configuration by deleting the *.pro.user file.

          However, using Git for backups is still the recommended solution.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • A Offline
            A Offline
            achmed
            wrote on last edited by
            #5

            Ok. Does make sense.
            But I cant spot the build path in the pro.user file.
            The file is to big to post here. Is there a particular variable or tag I should be looking for.
            Or did you not maybe mean that it should be in the .pro file???

            According to the build settings in QtCreator it should build to the following path:

            ../build-%{CurrentProject:Name}-%{CurrentKit:FileSystemName}-%{CurrentBuild:Name}

            This means it should build in the source folder each time.

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              [quote author="achmed" date="1415190606"]I cant spot the build path in the pro.user file.
              The file is to big to post here. Is there a particular variable or tag I should be looking for.
              Or did you not maybe mean that it should be in the .pro file???[/quote]I meant the .pro.user file.

              Search for the string "ProjectExplorer.BuildConfiguration.BuildDirectory"

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • A Offline
                A Offline
                achmed
                wrote on last edited by
                #7

                Bingo. Thank you very much. You where of great help. Now things make much more sense. I Will look into Git and try to implement it ASAP. :)

                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