I will use the solution with the QTimer, it gives better results than using qApp->processEvents();

Thanks for your help.