From da722fb448f06cf43780e6f857a1ccd9f07176d6 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 26 Apr 2018 16:06:45 +0200 Subject: Replace MultiPtHndlr.pointDistanceThreshold with PointerHandler.margin It's not just useful for PinchHandler: TapHandler has a good use for it too. But unfortunately if the handler's parent Item has a custom mask, we don't have a way to augment the mask with a margin; so if margin is set, we assume the bounds are rectangular. QQuickMultiPointHandler::eligiblePoints() now calls wantsEventPoint() rather than bounds-checking the point directly: this adds flexibility, potentially allowing an override in subclasses, if we need it later. Task-number: QTBUG-68077 Change-Id: I65c95f00c532044a5862654e58c9c5f8c973df81 Reviewed-by: Qt CI Bot Reviewed-by: Shawn Rutledge --- src/quick/items/qquickitem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/quick/items/qquickitem.cpp') diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 3b1402fe16..b09dbdad84 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -5140,6 +5140,17 @@ void QQuickItemPrivate::deliverShortcutOverrideEvent(QKeyEvent *event) } } +bool QQuickItemPrivate::anyPointerHandlerWants(QQuickEventPoint *point) const +{ + if (!hasPointerHandlers()) + return false; + for (QQuickPointerHandler *handler : extra->pointerHandlers) { + if (handler->wantsEventPoint(point)) + return true; + } + return false; +} + /*! \internal Deliver the \a event to all PointerHandlers which are in the pre-determined -- cgit v1.2.3