Important: Please read the Qt Code of Conduct -

Problem QProgressBar under QMainWidow and Qdialog

  • Hello,

    I would like to know if it is possible to update a QMainWindow that is working behind a Qdialog?



  • Just to update the MainWindow, yes, off course it is. Even when the Dialog is modal (blocking inputs to the MainWindow) the mainwindow itself still runs it's event loop. So updates to GUI elements are still shown. You probably want to update the mainwindow from the dialog?? If so, you might need to use the parent pointer, but then still ui (from designer) elements are not accessible (KEEP IT THAT WAY!!). You need to have "set" function to call in which you may set new ui values.

  • Hello,

    Thank you for having answered quickly. And I found my problem, I had to put a repaint() to update my window. I wanted to update the progressbar gradually before the QDialog opened.


Log in to reply