From 1188c199beaacd0ffc3ef39716dd648d41f4d3d2 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 29 Jul 2010 10:59:26 +1000 Subject: Don't emit movementEnded if mouse press is a continuation of a flick. When the mouse is pressed the flick is stopped, but this may be a continuation of a previous flick, in which case we don't want to emit movementEnded since this can cause stutters in animations triggered by movementEnded, for example. Task-number: QTBUG-12492 Reviewed-by: Warwick Allison --- .../graphicsitems/qdeclarativeflickable.cpp | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index b286e11..998b33a 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -1426,21 +1426,23 @@ void QDeclarativeFlickable::movementEnding() if (!d->flickingHorizontally) emit flickEnded(); } - if (d->movingHorizontally) { - d->movingHorizontally = false; - d->hMoved = false; - emit movingChanged(); - emit movingHorizontallyChanged(); - if (!d->movingVertically) - emit movementEnded(); - } - if (d->movingVertically) { - d->movingVertically = false; - d->vMoved = false; - emit movingChanged(); - emit movingVerticallyChanged(); - if (!d->movingHorizontally) - emit movementEnded(); + if (!d->pressed && !d->stealMouse) { + if (d->movingHorizontally) { + d->movingHorizontally = false; + d->hMoved = false; + emit movingChanged(); + emit movingHorizontallyChanged(); + if (!d->movingVertically) + emit movementEnded(); + } + if (d->movingVertically) { + d->movingVertically = false; + d->vMoved = false; + emit movingChanged(); + emit movingVerticallyChanged(); + if (!d->movingHorizontally) + emit movementEnded(); + } } d->hData.smoothVelocity.setValue(0); d->vData.smoothVelocity.setValue(0); -- cgit v0.12