Qt - UI Files Not Updating in Visual Studio

前端 未结 2 1519
南旧
南旧 2021-01-07 05:58

I recently started working with Qt (sort of a crash course) and integrated it with Visual Studio (as described here), and now for some reason the files don\'t appear to be u

相关标签:
2条回答
  • 2021-01-07 06:25

    The ui_MainForm.h file does not get updated automatically as soon as you change the MainForm.ui file.

    Only when you start to compile your project, the .ui file will be compiled into the .h file. If you want to update the .h file, e.g. for the sake of IntelliSense, you should be able to right click the .ui file and click "Compile". This runs uic.exe and you will have your .h file updated by that.

    [Edit:]
    As pointed out by rcmadruga and Summer Sun, it is sometimes necessary to additionally update your IntelliSense database by selecting the menu entry Project->Rescan Solution which was introduced with Visual Studio 2010.

    0 讨论(0)
  • 2021-01-07 06:40

    The ui_*.h file gets updated after running uic.exe, which usually happens in the build process. I'm not sure about how the VS integration works, but if it's important to You to have the header updated then you can run uic manually or possibly via some menu option provided by the Qt VS Integration.

    0 讨论(0)
提交回复
热议问题