diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-01-18 13:36:26 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-01-18 13:36:26 +0100 |
commit | deb779cdbaeeaea52ca0e99c9295db587c25f41c (patch) | |
tree | 82765e08678818ed21a6f9d5354ac852b0613460 /src/quickcontrols2 | |
parent | 26056b52b182b4452855f54a2c811d64246c434a (diff) | |
parent | d64774add9fafa24406a202d0313e10780e1e715 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts:
src/imports/controls/Tumbler.qml
src/quicktemplates2/qquicktumbler.cpp
src/quicktemplates2/qquicktumbler_p.h
src/quicktemplates2/qquicktumbler_p_p.h
Change-Id: I8d50991183fe3c5b50a49e00f01bcd3049f5346c
Diffstat (limited to 'src/quickcontrols2')
-rw-r--r-- | src/quickcontrols2/qquicktumblerview.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quickcontrols2/qquicktumblerview.cpp b/src/quickcontrols2/qquicktumblerview.cpp index e8f0c364..4469810c 100644 --- a/src/quickcontrols2/qquicktumblerview.cpp +++ b/src/quickcontrols2/qquicktumblerview.cpp @@ -173,14 +173,19 @@ 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); // Give the view a size. updateView(); // Set the model. updateModel(); + + // Set these after the model is set so that the currentItem animation + // happens instantly on startup/after switching models. If we set them too early, + // the view animates any potential currentIndex change over one second, + // which we don't want when the contentItem has just been created. + m_listView->setDelegate(m_delegate); + m_listView->setHighlightMoveDuration(1000); } } } |