Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistview / data / qtbug16037.qml
1 import QtQuick 1.0
2
3 Item {
4     width: 640
5     height: 480
6
7     function setModel() {
8         listView.model = listModel1
9     }
10
11     ListModel {
12         id: listModel1
13         ListElement { text: "Apple" }
14         ListElement { text: "Banana" }
15         ListElement { text: "Orange" }
16         ListElement { text: "Coconut" }
17     }
18
19     Rectangle {
20         width: 200
21         height: listView.contentHeight
22         color: "yellow"
23         anchors.centerIn: parent
24
25         ListView {
26             id: listView
27             objectName: "listview"
28             anchors.fill: parent
29
30             delegate: Item {
31                 width: 200
32                 height: 20
33                 Text { text: model.text; anchors.centerIn: parent }
34             }
35         }
36     }
37 }