aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2014-07-23 19:39:26 -0500
committerMichael Brasser <michael.brasser@live.com>2014-07-24 15:40:09 +0200
commit2c80968d21ff15f574cbbfd93ce4409cda7eeebf (patch)
treee3c0ee8a353b65e4a8a796c2d310df4866f79c28 /src/quick/items
parent36a179e8faa572544b9e8a9442f8c679a9509423 (diff)
Improve programmatic flicking of ListView (and Flickable).
Fix bug when programmatically flicking ListView after a real flick in the opposite direction. Also ensure a programmatic flick can flick past bounds when situated at the bounds and DragAndOvershootBounds is set. Task-number: QTBUG-38209 Change-Id: If4a2f65d0e7cb620b9af21f8a25a8a8797976125 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickflickable.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 45566f2e89..ee71ea8a76 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -327,7 +327,7 @@ bool QQuickFlickablePrivate::flick(AxisData &data, qreal minExtent, qreal maxExt
maxDistance = qAbs(maxExtent - data.move.value());
data.flickTarget = maxExtent;
}
- if (maxDistance > 0) {
+ if (maxDistance > 0 || boundsBehavior == QQuickFlickable::DragAndOvershootBounds) {
qreal v = velocity;
if (maxVelocity != -1 && maxVelocity < qAbs(v)) {
if (v < 0)
@@ -1541,6 +1541,10 @@ void QQuickFlickable::geometryChanged(const QRectF &newGeometry,
void QQuickFlickable::flick(qreal xVelocity, qreal yVelocity)
{
Q_D(QQuickFlickable);
+ d->hData.reset();
+ d->vData.reset();
+ d->hData.velocity = xVelocity;
+ d->vData.velocity = yVelocity;
bool flickedX = d->flickX(xVelocity);
bool flickedY = d->flickY(yVelocity);
d->flickingStarted(flickedX, flickedY);