Search
SailfishOS Open Build Service
>
Projects
>
home:kaltsi
:
tnhlbug
>
qt
> 0018-Nested-Flickables-with-pressDelay-flick-incorrect-Fl.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0018-Nested-Flickables-with-pressDelay-flick-incorrect-Fl.patch of Package qt
From 7a2424a30bb3a9774c1416fccbe6215f3997d9c4 Mon Sep 17 00:00:00 2001 From: Martin Jones <martin.jones@jollamobile.com> Date: Mon, 26 Nov 2012 11:20:20 +1000 Subject: [PATCH 18/29] Nested Flickables with pressDelay flick incorrect Flickable If the gesture is triggered within the pressDelay the outer Flickable will always handle the gesture. When the drag distance is exceeded replay the press event to allow all Flickables an opportunity to process the gesture normally. Task-number: QTBUG-28189 Change-Id: Idd01150efdb0239be498cfa1b171ae578fbc7ba8 --- .../graphicsitems/qdeclarativeflickable.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 338c1fc..9b819ca 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1697,6 +1697,22 @@ bool QDeclarativeFlickable::sendMouseEvent(QGraphicsSceneMouseEvent *event) switch(mouseEvent.type()) { case QEvent::GraphicsSceneMouseMove: + if (d->delayedPressEvent) { + // A move beyond the threshold replays the press to give nested Flickables + // the opportunity to grab the gesture. + QPointF delta = event->pos() - d->delayedPressEvent->pos(); + if (qAbs(delta.x()) > QApplication::startDragDistance() + || qAbs(delta.y()) > QApplication::startDragDistance()) { + // We replay the mouse press but the grabber we had might not be interessted by the event (e.g. overlay) + // so we reset the grabber + if (s->mouseGrabberItem() == d->delayedPressTarget) + d->delayedPressTarget->ungrabMouse(); + //Use the event handler that will take care of finding the proper item to propagate the event + QApplication::sendEvent(scene(), d->delayedPressEvent); + d->clearDelayedPress(); + // continue on to handle mouse move event + } + } d->handleMouseMoveEvent(&mouseEvent); break; case QEvent::GraphicsSceneMousePress: -- 1.7.10.3