Flickable: Fix bug when flicking twice using touches

When you flick twice in rapid succession, in the same direction,
the expected behavior is for flickable to be moving quite fast in the
direction of the flicks.

But when you flicked using touch events instead of mouse ones,
the second flick caused Flickable to immediately halt. This change fixes it.

Change-Id: I02bd02fed30bd4a98959194e04f0a26b4420cd05
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
This commit is contained in:
Daniel d'Andrada 2012-12-18 10:51:21 -02:00 committed by The Qt Project
parent 4baed7ba62
commit 27be7a832f
1 changed files with 5 additions and 0 deletions

View File

@ -2038,6 +2038,11 @@ bool QQuickFlickable::sendMouseEvent(QQuickItem *item, QMouseEvent *event)
QQuickWindow *c = window();
QQuickItem *grabber = c ? c->mouseGrabberItem() : 0;
if (grabber == this && d->stealMouse) {
// we are already the grabber and we do want the mouse event to ourselves.
return true;
}
bool grabberDisabled = grabber && !grabber->isEnabled();
bool stealThisEvent = d->stealMouse;
if ((stealThisEvent || contains(localPos)) && (!grabber || !grabber->keepMouseGrab() || grabberDisabled)) {