Important: Please read the Qt Code of Conduct -

[Solved] What would cause a mainwindow.ui file not to match with it ui_mainwindow.h file?

  • I am running into a situation where my designer (mainwindow.ui file) does not match my header (ui_mainwindow.h file). Is there a way to force the application to regenerate the ui_mainwindow.h file to sync up with the designer? I initially designed and implemented my application on linux. I then wanted to show proof of concept and run the same application on Window. That worked out well but when I made design changes on Window´s and recompiled it on the linux platform, I notice that my changes did not take affect. The designer look identical to the changes i made but the ui_mainwindow.h file does not contain the changes. When I run the application, it would display the application prior to my changes in window´s. Any insight would greatly be appreciated!

  • Clean All , Run qmake then Rebuild should help you with that type of issues

    Alternate method is to manually delete the auto-generated files and then rebuild

  • which file would be considered auto-generated?

  • ui_mainwindow.h is autogenerated file.

  • when you push Build -Clean all, ui_mainwindow.h gets deleted form "...-build-desktop" dir. Will be reborned at next build.

  • Problem resolved!!! Thank you so much guys... I noticed I had a copy of the auto-generated files in my working directory and a copy in my build directory. I removed them from my working directory and that seem to resolve the issue. Thanks again!

  • Please mark topic as [solved].

Log in to reply