aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
authorMichael Brasser <mbrasser@ford.com>2017-07-10 13:52:35 -0500
committerMichael Brasser <michael.brasser@live.com>2017-08-09 13:20:02 +0000
commitd419377d2041b35639a5ab81688a0bc30b5e2994 (patch)
tree6bd462b08675da01147417331d1208545c11197a /tests/auto/quick/qquicklistview/data
parent9e1497bed6f68d76e1ba8639a5ee9ca7056ef503 (diff)
Fix ListView::StrictlyEnforceRange with resizing delegate
When fixupPosition is called for a ListView with StrictlyEnforceRange, the original reason for the move is lost, and the fixup is applied immediately. There are already checks for whether the view is moving, so expand these checks to include movement caused by highlight. Change-Id: I25f771b9a529d31dc28acb9f91fcd2b582428200 Task-number: QTBUG-33568 Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml b/tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml
new file mode 100644
index 0000000000..338af38475
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/strictlyenforcerange-resize.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+
+ListView {
+ width: 400
+ height: 400
+ focus: true
+
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ highlightMoveVelocity: 200
+ preferredHighlightBegin: 150
+ preferredHighlightEnd: 150
+
+ property bool completed
+ Component.onCompleted: completed = true
+
+ model: 10
+ delegate: Item {
+ width: parent.width
+ height: ListView.isCurrentItem ? 100 : 50
+
+ Text {
+ anchors.centerIn: parent
+ text: index
+ }
+
+ Behavior on height {
+ enabled: completed
+ SmoothedAnimation { velocity: 200 }
+ }
+ }
+}