diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-12-23 00:20:23 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-12-23 00:23:34 (GMT) |
commit | 01fd44cd76f2da1dd1e39d7e5632b3274ca895a3 (patch) | |
tree | 24a5085367092757e03197b18a2211e140bb022c /src | |
parent | f360cc9b521e5e3e7d4b896627b3257365c6ad3c (diff) | |
download | Qt-01fd44cd76f2da1dd1e39d7e5632b3274ca895a3.zip Qt-01fd44cd76f2da1dd1e39d7e5632b3274ca895a3.tar.gz Qt-01fd44cd76f2da1dd1e39d7e5632b3274ca895a3.tar.bz2 |
Nested flickables would react alternately to flicks.
The grab was not always kept by filtering Flickables, but would remain
set next flick, resulting in toggling of flicking.
Task-number: QTBUG-16177
Reviewed-by: Michael Brasser
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeflickable.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index f1d92c5..f5da491 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -671,10 +671,12 @@ void QDeclarativeFlickable::setFlickableDirection(FlickableDirection direction) void QDeclarativeFlickablePrivate::handleMousePressEvent(QGraphicsSceneMouseEvent *event) { + Q_Q(QDeclarativeFlickable); if (interactive && timeline.isActive() && (qAbs(hData.velocity) > 10 || qAbs(vData.velocity) > 10)) stealMouse = true; // If we've been flicked then steal the click. else stealMouse = false; + q->setKeepMouseGrab(stealMouse); pressed = true; timeline.clear(); hData.velocity = 0; @@ -769,6 +771,8 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent } stealMouse = stealX || stealY; + if (stealMouse) + q->setKeepMouseGrab(true); if (!lastPos.isNull()) { qreal elapsed = qreal(QDeclarativeItemPrivate::restart(lastPosTime)) / 1000.; @@ -848,8 +852,6 @@ void QDeclarativeFlickable::mouseMoveEvent(QGraphicsSceneMouseEvent *event) Q_D(QDeclarativeFlickable); if (d->interactive) { d->handleMouseMoveEvent(event); - if (d->stealMouse) - setKeepMouseGrab(true); event->accept(); } else { QDeclarativeItem::mouseMoveEvent(event); |