GUI frozen when runnable is finish
-
I have a window with lot of QLabel which is for displaying image
but the image have to extract from zip file, it would takes some time.So I have a QObject called LoadManager (moveToThread of course)
which is receiving signal from window, new a LoadRunnable and push to QThreadPool to start.
When rannable is finished the image extraction, it emit a signal to the label with result (a pixmap)
then label show the pixmap.but the truth is , QLabels in mainThread do not update when they receive signal immediately, instead,
label start updating after all label has received the signal, and make window frozen.Why label is not updating immediately when it received signal?
Thanks for your reading. -
Signals sent cross-thread are queued, not instant/synchronous, and visual updates are also dependent on the Qt event loop being reached. If you block the event loop in your GUI thread then at least the visual updates will not happen.
You would need to show how the plumbing of your program is set up† for us to help identify where the blockage is.
† significant code snippets or, better yet, a complete, self-contained example that demonstrates the problem.