summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-07-29 00:59:26 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-07-29 00:59:26 (GMT)
commit1188c199beaacd0ffc3ef39716dd648d41f4d3d2 (patch)
treebb1a0982f322b92b3d8d966898492fd8d971c1d0 /src
parentf3f50543beebc41c69ac3a3fb296275fab12b604 (diff)
downloadQt-1188c199beaacd0ffc3ef39716dd648d41f4d3d2.zip
Qt-1188c199beaacd0ffc3ef39716dd648d41f4d3d2.tar.gz
Qt-1188c199beaacd0ffc3ef39716dd648d41f4d3d2.tar.bz2
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
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp32
1 files 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);