From a81655579c6799671a289b20f44a9d36e7584064 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 16 Feb 2012 10:18:56 +0100 Subject: [PATCH] Fix emitting originYChanged signals even when originY wouldn't change Same for originXChanged. Conflicts: src/quick/items/qquickflickable.cpp src/quick/items/qquickflickable_p_p.h Change-Id: I1a316f326b924da4722b692cf27db48312fc9236 Reviewed-by: Andras Becsi --- src/quick/items/qquickflickable.cpp | 12 ++++++++++-- src/quick/items/qquickflickable_p_p.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 0a8e220..a15f77d 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -540,12 +540,20 @@ void QQuickFlickablePrivate::updateBeginningEnd() if (vData.extentsChanged) { vData.extentsChanged = false; - emit q->originYChanged(); + qreal originY = q->originY(); + if (vData.origin != originY) { + vData.origin = originY; + emit q->originYChanged(); + } } if (hData.extentsChanged) { hData.extentsChanged = false; - emit q->originXChanged(); + qreal originX = q->originX(); + if (hData.origin != originX) { + hData.origin = originX; + emit q->originXChanged(); + } } if (atBoundaryChange) diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h index 49f27a4..ab5f03f 100644 --- a/src/quick/items/qquickflickable_p_p.h +++ b/src/quick/items/qquickflickable_p_p.h @@ -102,6 +102,7 @@ public: : move(fp, func) , transitionToBounds(0) , viewSize(-1), startMargin(0), endMargin(0) + , origin(0) , transitionTo(0) , continuousFlickVelocity(0), vTime(0) , smoothVelocity(fp), atEnd(false), atBeginning(true) @@ -146,6 +147,7 @@ public: qreal flickTarget; qreal startMargin; qreal endMargin; + qreal origin; qreal transitionTo; qreal continuousFlickVelocity; QElapsedTimer velocityTime; -- 1.7.2.5