Important: Please read the Qt Code of Conduct -

Issues with QT Designer

  • Good afternoon,

    I'm having an issue with QT designer where I add, say, a button or label. When I attempt to edit the associated .cpp file, the button or label cannot be found or compiled with. When I comment out any reference to the label or button, compile and run, the GUI is an old copy without the addition of the new labels; however, I can see them in designer. I've done a clean, qmake, and rebuild. I'm not entirely sure what is causing the disconnect with the designer. Any suggestions?


  • Hi @HunterMetcalfe
    need some more detail about your query to understand what happening.
    can you paste your piece of code here.

  • It's not entirely code based. In the designer I drag and drop in a new QLabel called label. Then in my MainWindow.cpp, I attempt to do, ui->label->(some function). However, the compiler cannot find the reference to label in the ui_MainWindow.h file. That is the issue. The ui_MainWindow.h file is not being updated properly.

  • I have solved the issue here. In the Projects section on the left pane of QT, the option for Shadow build was selected. Unselecting this option corrected the issues with the ui_MainWindow.h files not being generated properly.

Log in to reply