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. How to generate ui_*.h files in Visual Studio
QtWS25 Last Chance

How to generate ui_*.h files in Visual Studio

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 3 Posters 4.2k 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.
  • K Offline
    K Offline
    kitfox
    wrote on last edited by kitfox
    #1

    I started a new Qt project in Visual Studio. Then I clicked on Rebuild Solution and now all the header files from my various UI component have been deleted. How can I get Visual Studio to recreate these?

    Visual Studio is reporting errors like:

    1>------ Build started: Project: Goldfinch, Configuration: Debug x64 ------
    1>Goldfinch.cpp
    1>main.cpp
    1>PropertiesViewer.cpp
    1>moc_Goldfinch.cpp
    1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file ui\PropertiesViewer.cpp)
    1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file .\GeneratedFiles\Debug\moc_Goldfinch.cpp)
    1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file Goldfinch.cpp)
    1>moc_PropertiesViewer.cpp
    1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file main.cpp)
    1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file .\GeneratedFiles\Debug\moc_PropertiesViewer.cpp)
    1>Done building project "Goldfinch.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    
    jsulmJ 1 Reply Last reply
    0
    • K kitfox

      I started a new Qt project in Visual Studio. Then I clicked on Rebuild Solution and now all the header files from my various UI component have been deleted. How can I get Visual Studio to recreate these?

      Visual Studio is reporting errors like:

      1>------ Build started: Project: Goldfinch, Configuration: Debug x64 ------
      1>Goldfinch.cpp
      1>main.cpp
      1>PropertiesViewer.cpp
      1>moc_Goldfinch.cpp
      1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file ui\PropertiesViewer.cpp)
      1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file .\GeneratedFiles\Debug\moc_Goldfinch.cpp)
      1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file Goldfinch.cpp)
      1>moc_PropertiesViewer.cpp
      1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file main.cpp)
      1>d:\dev\starling2\game\2019\goldfinchqt\goldfinch\ui\propertiesviewer.h(4): fatal error C1083: Cannot open include file: 'ui_PropertiesViewer.h': No such file or directory (compiling source file .\GeneratedFiles\Debug\moc_PropertiesViewer.cpp)
      1>Done building project "Goldfinch.vcxproj" -- FAILED.
      ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @kitfox ui_*.h headers are generated by uic tool.
      Delete old build folder, run qmake and build.

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

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kitfox
        wrote on last edited by
        #3

        How do you run qmake?

        1 Reply Last reply
        0
        • VRoninV Offline
          VRoninV Offline
          VRonin
          wrote on last edited by
          #4

          qmake is an alternative to the Visual studio build system.
          Did you install the Qt Visual Studio Addin from the Addin Manager of VS?

          "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
          ~Napoleon Bonaparte

          On a crusade to banish setIndexWidget() from the holy land of Qt

          1 Reply Last reply
          0
          • K Offline
            K Offline
            kitfox
            wrote on last edited by
            #5

            The Addin Manager no longer seems to be part of Visual Studio. I did install the Qt Visual Studio Tools, but I don't know if that includes the tool you're referring to.

            jsulmJ VRoninV 2 Replies Last reply
            0
            • K kitfox

              The Addin Manager no longer seems to be part of Visual Studio. I did install the Qt Visual Studio Tools, but I don't know if that includes the tool you're referring to.

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

              @kitfox said in How to generate ui_*.h files in Visual Studio:

              Qt Visual Studio Tools

              I guess you're not using qmake then (I don't use Visual Studio). Then delete build folder and build.

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

              1 Reply Last reply
              0
              • K kitfox

                The Addin Manager no longer seems to be part of Visual Studio. I did install the Qt Visual Studio Tools, but I don't know if that includes the tool you're referring to.

                VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #7

                @kitfox said in How to generate ui_*.h files in Visual Studio:

                The Addin Manager no longer seems to be part of Visual Studio

                Sorry, now it's called "extensions and updates"

                "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                ~Napoleon Bonaparte

                On a crusade to banish setIndexWidget() from the holy land of Qt

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kitfox
                  wrote on last edited by
                  #8

                  The Qt Visual Studio Tools are installed and I was using them earlier to create a new project. I don't see anything in there about qmake, though. Do you know how to run it?

                  Which folder is the build folder? I've deleted x64/Debug which seems to contain everything generated during the build, but when I do a build after that I get the error message I posted above.

                  VRoninV 1 Reply Last reply
                  0
                  • K kitfox

                    The Qt Visual Studio Tools are installed and I was using them earlier to create a new project. I don't see anything in there about qmake, though. Do you know how to run it?

                    Which folder is the build folder? I've deleted x64/Debug which seems to contain everything generated during the build, but when I do a build after that I get the error message I posted above.

                    VRoninV Offline
                    VRoninV Offline
                    VRonin
                    wrote on last edited by
                    #9

                    @kitfox said in How to generate ui_*.h files in Visual Studio:

                    I don't see anything in there about qmake

                    qmake is the build system used by Qt Creator, it is not used by Visual Studio.

                    Unfortunately I'm not aware of a way to convert a VS project that was not created with the Qt VS Tools to one compatible so I'm afraid you need to rebuild your project from scratch using the Qt template

                    "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                    ~Napoleon Bonaparte

                    On a crusade to banish setIndexWidget() from the holy land of Qt

                    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