Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

main window does not update new label name



  • Hi,

    I made a very simple tutorial application where a clicked button update a label text.
    However, the text is not updated on button click.
    It updates first after for example resize the window.

    How to make the text update directly on the button click?

    void MainWindow::on_pushButton_2_clicked()
    {
    ui->label->setText("button is clicked");
    }


  • Qt Champions 2017

    This should work. Can you share complete example or sample code on how u create the object, button etc?.


Log in to reply