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. Moc and ui*.h files always get deleted when I switching platform
QtWS25 Last Chance

Moc and ui*.h files always get deleted when I switching platform

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 1.5k 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.
  • L Offline
    L Offline
    lucky7456969
    wrote on last edited by
    #1

    I probably messed up my QT installation on my host.
    Whenever I start a QT application, after switching to x64 platform
    and choosing QT version, the ui and moc's files always go missing.
    Hoping someone here can help me fix this issue.
    I think I should have started every project on a VM, this time I didn't,
    so regretting.
    Windows 7 x64
    Visual Studio 2010 Ultimate SP1
    Thanks
    Jack

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      The files with .moc extension are generated files.
      The .ui files should be part of you sources tree.

      Does it happen in Visual Studio Qt Add-On or QtCreator?

      1 Reply Last reply
      0
      • X Offline
        X Offline
        Xander84
        wrote on last edited by
        #3

        @andreyc: I think he means the generated ui*.h files, not the .ui files itself and those are generated files as well and only temporary so you should never modify those files anyway. I don't think the files get deleted if I change the build kit, but still that should be no problem really.
        What are you trying to do? :)

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lucky7456969
          wrote on last edited by
          #4

          Hi,
          It happens in Visual Studio Qt Add-On.
          I forgot I have changed the environment variable "path" or something
          But when I point it back to the directory
          say
          X:\QT5\qtbase\bin
          the problem starts to appear.
          This both happens when I open an old project and create a new one.
          Thanks
          Jack

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

            As Xander84 pointed, most likely you are looking at the generated files.
            The "moc":http://qt-project.org/doc/qt-5/moc.html#moc and "uic":http://qt-project.org/doc/qt-5/uic.html generate the moc_*.cpp, *.moc, and ui_*h files during build.

            So, when you create new project the files do not exists until you run first build.
            In old project they will disappear when you run "make clear"

            Why do you need these generated files?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              Asperamanca
              wrote on last edited by
              #6

              You can conditionally set MOC_DIR, RCC_DIR, UI_HEADERS_DIR and UI_SOURCES_DIR variables in your .pro file depending on your platform. That way, the files are generated in separate locations.
              You should consider doing this for OBJECTS_DIR and DESTDIR as well, if you are serious about switching platforms.

              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