From af21677f473bce12ee7c725b1151ae794384ae76 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 7 Feb 2017 13:24:49 +0100 Subject: QQuickWindow: remove sendFilteredTouchEvent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The functionality is now completely assimilated into sendFilteredPointerEvent. Flickable can now steal the touch grab from a TapHandler child, for example: the TapHandler grabbed the eventpoint, whereas QQuickFlickable::childMouseEventFilter() was given a synthetic mouse event derived from the touchpoint which the eventpoint represented, and we fully follow through the consequences of that. If an Item filters a press event, avoid doing normal delivery to that same Item again. Change-Id: Icd9c88ab752f2b728f7d612504013c6dc72ff9fe Reviewed-by: Jan Arve Sæther --- src/quick/items/qquickevents.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/quick/items/qquickevents.cpp') diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index c3f6964ba6..0af19ff750 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -896,6 +896,10 @@ bool QQuickPointerMouseEvent::allPointsAccepted() const { return m_mousePoint->isAccepted(); } +bool QQuickPointerMouseEvent::allUpdatedPointsAccepted() const { + return m_mousePoint->state() == QQuickEventPoint::Pressed || m_mousePoint->isAccepted(); +} + bool QQuickPointerMouseEvent::allPointsGrabbed() const { return m_mousePoint->grabber() != nullptr; @@ -941,6 +945,15 @@ bool QQuickPointerTouchEvent::allPointsAccepted() const { return true; } +bool QQuickPointerTouchEvent::allUpdatedPointsAccepted() const { + for (int i = 0; i < m_pointCount; ++i) { + auto point = m_touchPoints.at(i); + if (point->state() != QQuickEventPoint::Pressed && !point->isAccepted()) + return false; + } + return true; +} + bool QQuickPointerTouchEvent::allPointsGrabbed() const { for (int i = 0; i < m_pointCount; ++i) { -- cgit v1.2.3