Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. GUI frozen when runnable is finish
Forum Updated to NodeBB v4.3 + New Features

GUI frozen when runnable is finish

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 168 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pachisuro4096
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved