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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 6.0.0 RC
    • 5.15.1
    • Core: Event loop
    • None
    • CMake build, Visual Studio, Debug/Release configuration
    • Windows
    • 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

            thiago Thiago Macieira
            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