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

QPrintDialog::exec does not properly block in certain circumstances

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.2.6
    • GUI: Printing
    • None
    • macOS

    Description

      The expectation is that QPrintDialog::exec() is a blocking operation. It seems however if an event from the eventloop triggers the print action AND there is an expensive calculation between the event trigger and the QPrintDialog::exec call, extra events can get processed while in the QPrintDialog::exec call.

      A simple example of this would be a "Print" button that someone double clicks instead of single clicks (as users are known to do). The first click event goes into the print code and executes QPrintDialog::exec. Within exec, it seems like more events are allowed to process, at which time the second click event calls QPrintDialog::exec a second time. The end result is two print dialog open at the same time. Additionally, depending on implementation, errors or crashes can easily occur.

      Please see the attached minimal example.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            ultim8 Jason Dolan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes