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

Reverse the order of event filters in ExtraData::eventFilters

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • None
    • Core: Object Model
    • None
    • 1fe88bf4c (dev), 2e6e0c6bb (6.7), a04811a82 (6.6), 2f4b8ebc4 (tqtc/lts-6.5), 22f6a88ba (tqtc/lts-6.2), 648f2a968 (tqtc/lts-5.15)

      The eventFilter list is currently iterated forwards when applying event filters, so new filters are prepend()ed to it. It's a QList, which has efficient prepends(), but installEventFilter() remove()s nullptr and the object itself in order to prepend() without creating duplicates and remove() leaves empty space at the back while prepend() of course needs it in the front.

      Remove this impedance mismatch by append()ing new event filters to the list, which means we need to use reverse iteration when applying them.

      As a user-visible effect, this may enable installEventFilter() from eventFilter(), which, with the current implementation, may cause filters to be skipped. Need to be careful to not apply event filters twice, then, though.

      References:

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

            thiago Thiago Macieira
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: