From 98e7ec5920a8c5e2408c662c6cf2b78cfdb9c727 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Mon, 8 Oct 2018 15:50:30 +0200 Subject: 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 --- src/quick/items/qquickitemview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/quick') 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); -- cgit v1.2.3