summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativeflickable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeflickable.cpp')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp58
1 files changed, 33 insertions, 25 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 03ba740d0b..61b4dcd8db 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -681,12 +681,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (newY < maxY && maxY - minY <= 0)
newY = maxY + (newY - maxY) / 2;
if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newY > minY || newY < maxY)) {
- if (newY > minY)
- newY = minY;
- else if (newY < maxY)
+ rejectY = true;
+ if (newY < maxY) {
newY = maxY;
- else
- rejectY = true;
+ rejectY = false;
+ }
+ if (newY > minY) {
+ newY = minY;
+ rejectY = false;
+ }
}
if (!rejectY && stealMouse) {
vData.move.setValue(qRound(newY));
@@ -708,12 +711,15 @@ void QDeclarativeFlickablePrivate::handleMouseMoveEvent(QGraphicsSceneMouseEvent
if (newX < maxX && maxX - minX <= 0)
newX = maxX + (newX - maxX) / 2;
if (boundsBehavior == QDeclarativeFlickable::StopAtBounds && (newX > minX || newX < maxX)) {
- if (newX > minX)
- newX = minX;
- else if (newX < maxX)
+ rejectX = true;
+ if (newX < maxX) {
newX = maxX;
- else
- rejectX = true;
+ rejectX = false;
+ }
+ if (newX > minX) {
+ newX = minX;
+ rejectX = false;
+ }
}
if (!rejectX && stealMouse) {
hData.move.setValue(qRound(newX));
@@ -1466,21 +1472,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);