简体   繁体   中英

Qt and MSVC issue with .ui file not updating

I found a sample on the Ogre forums of using Qt and Ogre together. I setup Qt, installed the MSVC plugin and created a new Qt project. I added all of the files, everything ran great.

I double clicked the .ui file in MSVC and it brought up Qt Designer, where I changed the window title and saved. For some reason, no matter what changes I make to the .ui file, they are not being reflected in the project. I verified it saved the changes, there are no issues when building, so im lost.

Any ideas would be great, thank you.

Here is the project file if it would help to look at it.

http://brutalservers.net/qtOgre.zip

Qt uses 3 programs, ui, rcc and moc to update/generate files. Their functions are listed below.

File Type    Program                              Function
========     ========    =========================================================
  .ui        ui.exe      Generate ui_*****.h file that contains code that builds 
                           the screen at run time
  .rcc       rcc.exe     Compiles resource file into file that VS can compile 
                          into your binary program.
  .h         moc.exe     Any header file that contains Q_OBJECT macro needs to 
                          have a "moc" file generated that contains code to 
                          connect your class to Qt's signal/slot  system.

For this to work, Qt adds custom compiler action to the properties of each of these file types. For Qt to add these actions, you have to set the project's "Qt Version" in the Qt Project Properties. Below is popup to fill this in for VS2010.

VS2010的Qt项目设置

Once you set the value, Qt will update the custom compiler actions for the files in the project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM