Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-135797

Make calling processEvents() from inside QProgressDialog::setValue() optional

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.0
    • None
    • All
    • c8b09a8d4 (master)

    Description

      QProgressDialog::setValue() calls QCoreApplication::processEvents() when the dialog is modal. While this might be a solution to force the repaint of the dialog when the user code blocks the main thread for a long time, this causes serious issues when the progress updates are periodical and the user code relies on not processing the events when driving the GUI.

      Please also note, that the current behavior isn't really consistent, since QProgressDialog::setLabelText() doesn't call QCoreApplication::processEvents(), thus it won't repaint properly in case the user blocks the main thread.

      The simplest solution would be to remove a call to QCoreApplication::processEvents() and leave the user to do this explicitly. Unfortunately, this would break the existing behaviour.

      The proposal is to introduce a flag (e.g. processEventOnSetValue), which is true by default (to not break the existing behavior) and when the flag is off - omit the calls to QCoreApplication::processEvents().

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-135797
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              jkobus Jarek Kobus
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes