diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-10-08 15:50:30 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-10-11 20:30:22 +0000 |
commit | 98e7ec5920a8c5e2408c662c6cf2b78cfdb9c727 (patch) | |
tree | a6630d9fdef8c37288bce0d27e05e4e5908638a6 /src | |
parent | a4852b1ee77a913f6cc4806e6606c1b720e8f40b (diff) |
Item Views: cancel flicking before programmatic absolute positioning
When the velocity timeline is driving movement and simultaneously
someone calls positionViewAtIndex(), it gets very confused and goes
on creating and destroying delegates for a very long time. So now we
cancel the flicking animation immediately when calling any of the
positionViewAt* invokables.
Fixes: QTBUG-70941
Change-Id: I85e09344e79356b877a57ab634f72be1d7f93fca
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickitemview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/qquickitemview.cpp b/src/quick/items/qquickitemview.cpp index 7493bdafda..a1a71bf3cd 100644 --- a/src/quick/items/qquickitemview.cpp +++ b/src/quick/items/qquickitemview.cpp @@ -829,6 +829,8 @@ void QQuickItemViewPrivate::positionViewAtIndex(int index, int mode) if (mode < QQuickItemView::Beginning || mode > QQuickItemView::SnapPosition) return; + Q_Q(QQuickItemView); + q->cancelFlick(); applyPendingChanges(); const int modelCount = model->count(); int idx = qMax(qMin(index, modelCount - 1), 0); |