aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2017-12-14 14:34:09 +0100
committerMitch Curtis <mitch.curtis@qt.io>2017-12-14 14:41:35 +0000
commit8e4b91030fa73a84dd4704d2d0073e63e4646fed (patch)
treecac1675734dd387045268e84d5e2a62f1d045ffe /src
parent4206f54c5080c0e45aabd42d6c6590b04b84b6a1 (diff)
Tumbler: ensure that currentIndex animations aren't too slow
The default (for ListView) is 400 pixels a second, which is really slow when there are 1000 items. Set highlightMoveDuration to 1000 (one second) for both view types to ensure a constant amount of time to animate currentIndex changes. [ChangeLog][Controls][Tumbler] Made currentIndex animations take a constant amount of time (1 second) regardless of how many items are in the model. This prevents Tumblers with large amounts of items from scrolling too slowly when changing the currentIndex. Task-number: QTBUG-65165 Change-Id: I0342236e49fae346926eb7e8a5fb6ed0813e457e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quickcontrols2/qquicktumblerview.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquicktumblerview.cpp b/src/quickcontrols2/qquicktumblerview.cpp
index 5e6d9f5a..e8f0c364 100644
--- a/src/quickcontrols2/qquicktumblerview.cpp
+++ b/src/quickcontrols2/qquicktumblerview.cpp
@@ -148,6 +148,7 @@ void QQuickTumblerView::createView()
m_pathView->setDelegate(m_delegate);
m_pathView->setPreferredHighlightBegin(0.5);
m_pathView->setPreferredHighlightEnd(0.5);
+ m_pathView->setHighlightMoveDuration(1000);
m_pathView->setClip(true);
// Give the view a size.
@@ -172,6 +173,7 @@ void QQuickTumblerView::createView()
m_listView->setParentItem(this);
m_listView->setSnapMode(QQuickListView::SnapToItem);
m_listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange);
+ m_listView->setHighlightMoveDuration(1000);
m_listView->setClip(true);
m_listView->setDelegate(m_delegate);