This seems like it should be automatic, but apparently it\'s not. I have the following code:
ui.my_label->setText(\"Test 1...\");
ui.my_label->
Defining a function...
void YourClass::Update_Ui()
{
if(this->isEnabled())
return;
this->repaint();
qApp->processEvents();
}
...like this and make sure this is disabled (to prevent user actions) while you want to force an update of the ui was the best solution for me.
Example how to use it inside a function (for example during a stack processing that takes lots of time):
this->setEnabled(false);
//Do whatever you want
Update_Ui();
//Do some other stuff
this->setEnabled(true);
This doesn't allow the user to disturb the processing by ui interaction (it is disabled) and updates whenever Update_Ui(); is called in the code and updates the whole ui, not just a chosen label or whatever. Note that this doesn't block signals fired by ui elements.