Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistview / data / displaylist.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     id: root
5     property real delegateHeight: 20
6     width: 240
7     height: 320
8     color: "#ffffff"
9     resources: [
10         Component {
11             id: myDelegate
12             Rectangle {
13                 id: wrapper
14                 objectName: "wrapper"
15                 height: root.delegateHeight
16                 Behavior on height { NumberAnimation {} }
17                 width: 240
18                 Text {
19                     text: index
20                 }
21                 Text {
22                     x: 30
23                     objectName: "displayText"
24                     text: display
25                 }
26                 Text {
27                     x: 200
28                     text: wrapper.y
29                 }
30                 color: ListView.isCurrentItem ? "lightsteelblue" : "white"
31             }
32         },
33         Component {
34             id: myHighlight
35             Rectangle { color: "green" }
36         }
37     ]
38     ListView {
39         id: list
40         objectName: "list"
41         focus: true
42         width: 240
43         height: 320
44         model: testModel
45         delegate: myDelegate
46         highlight: myHighlight
47         highlightMoveSpeed: 1000
48         highlightResizeSpeed: 1000
49     }
50 }