From cdbae41f10e13720ff8de6b94491c9cad07a2533 Mon Sep 17 00:00:00 2001
From: Martin Jones <martin.jones@nokia.com>
Date: Mon, 9 Nov 2009 16:50:31 +1000
Subject: Visual test for ListView.

---
 .../auto/declarative/visual/ListView/listview.qml  | 81 ++++++++++++++++++++++
 1 file changed, 81 insertions(+)
 create mode 100644 tests/auto/declarative/visual/ListView/listview.qml

diff --git a/tests/auto/declarative/visual/ListView/listview.qml b/tests/auto/declarative/visual/ListView/listview.qml
new file mode 100644
index 0000000..fb9eecd
--- /dev/null
+++ b/tests/auto/declarative/visual/ListView/listview.qml
@@ -0,0 +1,81 @@
+import Qt 4.6
+
+Rectangle {
+    width: 600; height: 300; color: "white"
+
+    ListModel {
+        id: myModel
+        ListElement {
+            itemColor: "red"
+        }
+        ListElement {
+            itemColor: "green"
+        }
+        ListElement {
+            itemColor: "blue"
+        }
+        ListElement {
+            itemColor: "orange"
+        }
+        ListElement {
+            itemColor: "brown"
+        }
+        ListElement {
+            itemColor: "yellow"
+        }
+        ListElement {
+            itemColor: "purple"
+        }
+        ListElement {
+            itemColor: "darkred"
+        }
+        ListElement {
+            itemColor: "darkblue"
+        }
+    }
+
+    Component {
+        id: myDelegate
+        Item {
+            width: 200; height: 50
+            Rectangle {
+                x: 5; y : 5
+                width: 190; height: 40
+                opacity: 0.5
+                color: itemColor
+            }
+        }
+    }
+
+    Component {
+        id: myHighlight
+        Rectangle { color: "black" }
+    }
+
+    ListView {
+        id: list1
+        width: 200; height: parent.height
+        model: myModel; delegate: myDelegate
+        highlight: myHighlight; currentIndex: list3.currentIndex
+        focus: true
+    }
+    ListView {
+        id: list2
+        x: 200; width: 200; height: parent.height
+        model: myModel; delegate: myDelegate; highlight: myHighlight
+        preferredHighlightBegin: 80
+        preferredHighlightEnd: 220
+        highlightRangeMode: "ApplyRange"
+        currentIndex: list1.currentIndex
+    }
+    ListView {
+        id: list3
+        x: 400; width: 200; height: parent.height
+        model: myModel; delegate: myDelegate; highlight: myHighlight
+        currentIndex: list1.currentIndex
+        preferredHighlightBegin: 125
+        preferredHighlightEnd: 125
+        highlightRangeMode: "StrictlyEnforceRange"
+        flickDeceleration: 1000
+    }
+}
-- 
cgit v0.12