diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-08-29 10:12:32 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-09-08 13:17:41 +0000 |
commit | 19054b5449755e27d54793492c41095cc630cb91 (patch) | |
tree | daa02000845edd82cfcd3c83f1cb6cfa57612136 /src/quick/items/qquickwindow_p.h | |
parent | f8ff08e31147a6ecf87d830b1cf632f64d19aab1 (diff) |
sendFilteredPointerEvent: go back to parent traversal
The filteringParentItems vector-of-pairs is getting more and more
questionable: it needs to have more pairs than we thought, then we
need to remove them to prevent multiple-filtering, and then we also
need to keep track of which ones we removed plus which ones are
actually filtering, in order to avoid direct delivery of pointer events
to the same Item after it already filtered from its children.
The overhead doesn't seem worthwhile anymore. So this conceptually
reverts 9b5fc80af28580e9672792dd511d876a93947882 but with some
improvements.
Also, do not deliver events to child-filtering items which have
already filtered.
Change-Id: I9d4f977dba695de7eb78ab536e0e6e8fd6a253a7
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow_p.h')
-rw-r--r-- | src/quick/items/qquickwindow_p.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 0bd909603d..2a2507904b 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -148,7 +148,8 @@ public: static QMouseEvent *cloneMouseEvent(QMouseEvent *event, QPointF *transformedLocalPos = 0); void deliverMouseEvent(QQuickPointerMouseEvent *pointerEvent); bool sendFilteredMouseEvent(QQuickItem *, QQuickItem *, QEvent *, QSet<QQuickItem *> *); - bool sendFilteredPointerEvent(QQuickPointerEvent *event, QQuickItem *receiver); + bool sendFilteredPointerEvent(QQuickPointerEvent *event, QQuickItem *receiver, QQuickItem *filteringParent = nullptr); + bool sendFilteredPointerEventImpl(QQuickPointerEvent *event, QQuickItem *receiver, QQuickItem *filteringParent); #if QT_CONFIG(wheelevent) bool deliverWheelEvent(QQuickItem *, QWheelEvent *); #endif @@ -178,7 +179,6 @@ public: QVector<QQuickItem *> pointerTargets(QQuickItem *, const QPointF &, bool checkMouseButtons, bool checkAcceptsTouch) const; QVector<QQuickItem *> mergePointerTargets(const QVector<QQuickItem *> &list1, const QVector<QQuickItem *> &list2) const; - void updateFilteringParentItems(const QVector<QQuickItem *> &targetItems); // hover delivery bool deliverHoverEvent(QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp, bool &accepted); @@ -227,7 +227,7 @@ public: QList<QSGNode *> cleanupNodeList; QVector<QQuickItem *> itemsToPolish; - QVector<QPair<QQuickItem *,QQuickItem *> > filteringParentItems; // item:parent pairs + QVector<QQuickItem *> hasFiltered; // during event delivery, the items for which childMouseEventFilter was already called qreal devicePixelRatio; QMetaObject::Connection physicalDpiChangedConnection; |