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. Dialog or Widgets redraw in a loop
Qt 6.11 is out! See what's new in the release blog

Dialog or Widgets redraw in a loop

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 587 Views 2 Watching
  • 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote on last edited by
    #1

    I want show a small dialog during a longer calculation.

    ShowDialog
    Calculations .................
    CloseDialog

    The dialog appears but shows only a white blank content.
    The following code after dialog showing does not help.
    // this == a QDialog subclass
    this->update();
    this->repaint();
    QCoreApplication::processEvents();

    How can I force a redraw of a dialog or single widgets out of the event-loop.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If your calculation is long enough processEvents won't really help. You have to either break it in smaller parts or move it outside the GUI thread.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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