Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistview / data / itemlist.qml
1 // This example demonstrates placing items in a view using
2 // a VisualItemModel
3
4 import QtQuick 1.0
5
6 Rectangle {
7     color: "lightgray"
8     width: 240
9     height: 320
10
11     VisualItemModel {
12         id: itemModel
13         objectName: "itemModel"
14         Rectangle {
15             objectName: "item1"
16             height: ListView.view.height; width: view.width; color: "#FFFEF0"
17             Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
18         }
19         Rectangle {
20             objectName: "item2"
21             height: ListView.view.height; width: view.width; color: "#F0FFF7"
22             Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
23         }
24         Rectangle {
25             objectName: "item3"
26             height: ListView.view.height; width: view.width; color: "#F4F0FF"
27             Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent }
28         }
29     }
30
31     ListView {
32         id: view
33         objectName: "view"
34         anchors.fill: parent
35         anchors.bottomMargin: 30
36         model: itemModel
37         preferredHighlightBegin: 0
38         preferredHighlightEnd: 0
39         highlightRangeMode: "StrictlyEnforceRange"
40         orientation: ListView.Horizontal
41         flickDeceleration: 2000
42     }
43 }