Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
-
1fe88bf4c (dev), 2e6e0c6bb (6.7), a04811a82 (6.6), 2f4b8ebc4 (tqtc/lts-6.5), 22f6a88ba (tqtc/lts-6.2), 648f2a968 (tqtc/lts-5.15)
Description
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: