From 8380e4c4a4f3f49a74a8bc0ff330e1c9e14dbafc Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 20 Nov 2018 16:01:20 +0100 Subject: Add handlers declared as Flickable children to its contentItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QQuickItemPrivate::data_append() was not invoked when any kind of Pointer Handler was directly declared in a Flickable (or subclass) because QQuickFlickable redefines the default property to be its own flickableData property. So we need to repeat the special handling in QQuickFlickablePrivate::data_append() too. The handler must be added to the private->extra->pointerHandlers vector, so that QQuickItemPrivate::handlePointerEvent() will attempt to deliver events to those handlers. TapHandler seems OK (especially with its default gesturePolicy so that it does not do an exclusive grab). PointHandler seems OK. DragHandler competes with Flickable for the exclusive grab. pressDelay can help; or set acceptedDevices: PointerDevice.Mouse to allow the mouse to drag but not flick, and the touchscreen to flick but not drag. Fixes: QTBUG-71918 Fixes: QTBUG-73035 Change-Id: Icb97ed5230abe0cb6ec0230b5b5759a0528df7e8 Reviewed-by: Jan Arve Sæther --- src/quick/handlers/qquicktaphandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/quick/handlers/qquicktaphandler.cpp') diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index f24b2bfd7e..c1658ec5d2 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtQuick module of the Qt Toolkit. @@ -315,6 +315,8 @@ void QQuickTapHandler::setPressed(bool press, bool cancel, QQuickEventPoint *poi if (cancel) { emit canceled(point); setExclusiveGrab(point, false); + // In case there is a filtering parent (Flickable), we should not give up the passive grab, + // so that it can continue to filter future events. reset(); emit pointChanged(); } -- cgit v1.2.3