Why changes on mainwindow.ui is not reflected when run. (solved)



  • After making changes to mainwindow.ui, the changes is not reflected when run.
    Time stamp on mainwindow.ui has been checked updated

    Suspect it is due to project file and object file in one folder. Like to ask how to create two seperate
    folder for each? and why changes on mainwindow.ui is not reflected when run.



  • Compiling the UI done by separate compiler called uic.exe. So check your compiler output. If it throws any error post it here or clean the project completely and rebuild the project.


  • Moderators

    You need to tell more about the envirnement you are using.
    In general it is easier to use an IDE like Qt creator. It does all the organisation and handling of the different tools.

    If you are using already Qt creator, you should rerun qmake and make rebuild of teh whole project. In most cases this will solve your problem.



  • a Promoted class QFrame(base class name) is set in a particular position many months ago.
    Now no matter how i shift the QWidget, the widget is fixed in that particular position. The position changes on mainwindow.ui is not reflected


  • Moderators

    Have you checked if uic is started at all?



  • uic reads XML format ui file and generate c++ header file.
    When runnning qmake, uic will be invoked automatically.
    This is written in qt help.

    Answer is to delete c++ header file



  • A strange behavior is, that if the UI_DIR folder will define after the first run of the project and in the root project folder the ui_*.h files already exist, these files will copy from the root folder to the UI_DIR folder and don´t create new actual ones.

    I was loooking for the problem for more than one hour, until I recognize that there are ui header files in the project root folder, then I delete them and everthing works like expected.



  • Suggestion. You might also check your .pro file. As you may recall, qmake will create the Makefile and your ui_ prefixed .h files will be generated by uic compiler. Typically placed in a .ui folder in your project, but you can over ride this and specify another location (if you wish).

    Make sure you specify the correct .ui directories and/or correct project directories. They may be
    going to another directory (see also Makefile) location than you expect. One thing you can also do
    is create a softlink (use: ln -s ) from .ui fiolder header files to project folder you want to specify (as another way to do that) as indicated in your .pro file.

    I've done that myself many times myself and saw no UI changes ..then said ..duh! ..lol

    -Vince


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.