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

QEventLoop::processEvents does not take the timeout into account as expected

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.15.1
    • Fix Version/s: 6.0.0 RC
    • Component/s: Core: Event loop
    • Labels:
      None
    • Environment:
      CMake build, Visual Studio, Debug/Release configuration
    • Platform/s:
      Windows
    • Commits:
      8ec9a48e80a72c7b9e82107a2c66de6cbf7a02fe 73e0a5a422f7c484a083c909e3b573429b7c3301 (qt/qtbase/5.15)

      Description

      In QEventLoop:: processEvents:

       

      https://github.com/qt/qtbase/blob/dev/src/corelib/kernel/qeventloop.cpp#L262

       

      there is a while loop, in which the timeout is checked. However the called bool processEvents(ProcessEventsFlags) function processes multiple events itself. Therefore, if multiple events are added to the event loop, all of them gets processed, independently of the timeout value.

       

      According to the documentation events should be only processed until the given timeout time is elapsed. I understand that executing a single event cannot be interrupted, but if there are multiple events the timeout should be checked after executing every single one of them.

        Attachments

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

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            tamas_szep Tamas Szep
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes