aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-05-28 14:06:13 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-28 07:17:09 +0200
commit81726bcb8d2ea58f785f7d1f3bb3de8bb089d6ec (patch)
tree545b9c91d4973998e8045661b6d2807ab15a84dc /tests/auto/quick/qquicklistview/data
parent2533a40cf26ded5b777aae6b3c49813a044ab735 (diff)
Fix flicker when changing ListView currentIndex with VisualItemModel.
Return the Referenced flag when the view has outstanding references otherwise it will attempt to hide an item if believes shouldn't be visible. Task-number: QTBUG-25849 Change-Id: I7387ab8322a1cd7f3386685086b2b8ad10c8b4f0 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/itemlist-flicker.qml46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/itemlist-flicker.qml b/tests/auto/quick/qquicklistview/data/itemlist-flicker.qml
new file mode 100644
index 0000000000..c0cc807bc0
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/itemlist-flicker.qml
@@ -0,0 +1,46 @@
+// This example demonstrates placing items in a view using
+// a VisualItemModel
+
+import QtQuick 2.0
+
+Rectangle {
+ color: "lightgray"
+ width: 240
+ height: 320
+
+ VisualItemModel {
+ id: itemModel
+ objectName: "itemModel"
+ Rectangle {
+ objectName: "item1"
+ height: view.height / 3
+ width: view.width; color: "#FFFEF0"
+ Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item2"
+ height: view.height / 3
+ width: view.width; color: "#F0FFF7"
+ Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ Rectangle {
+ objectName: "item3"
+ height: view.height / 3
+ width: view.width; color: "#F4F0FF"
+ Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
+ }
+ }
+
+ ListView {
+ id: view
+ objectName: "view"
+ anchors.fill: parent
+ anchors.bottomMargin: 30
+ model: itemModel
+ preferredHighlightBegin: 0
+ preferredHighlightEnd: 0
+ highlightRangeMode: "StrictlyEnforceRange"
+ orientation: ListView.Vertical
+ flickDeceleration: 2000
+ }
+}