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

ProcessEvents() with ExcludeUserInputEvents is discarding keystrokes [OS X only]

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.7.0, 5.7.1
    • QPA
    • None
    • Tested on
      {noformat}
      ProductName: Mac OS X
      ProductVersion: 10.11.3
      BuildVersion: 15D21
      {noformat}
    • macOS

      Running into an issue in Qt5 on OS X where calling

      QCoreApplication::processEvents()

      with the `ExcludeUserInputEvents` flag is causing keystrokes to get dropped on the floor instead of deferred until the next time `processEvents()` is called without that flag. This is resulting in issues for us trying to update the ui during longer operations without accepting user input, as any typing the user was doing can end up riddled with typos.

      Expected: Keystrokes pressed while the long timer operation is firing will get queued up and dispatched after the timer operation completes

      Observed: Keystrokes are instead discarded, resulting in garbled text

      Cause: Calling QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents) after a long operation. As per the docs, the `KeyEvent`s should be deferred, not discarded.

      This works as expected in Qt4 as well as on Windows Qt5

      To reproduce: See attached example. Try typing in the QLineEdit and notice keystrokes are getting lost instead of deferred

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

            qt.team.graphics.and.multimedia Qt Graphics Team
            jeremy Jeremy Cytryn
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes