Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / ListView / basic4.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     color: "blue"
5     width: 200
6     height: 300
7     id: page
8     ListModel {
9         id: model
10         ListElement {
11             name: "palegoldenrod"
12         }
13         ListElement {
14             name: "lightsteelblue"
15         }
16     }
17     Component {
18         id: delegate
19         Rectangle {
20             color: "red"
21             width: 100
22             height: 100
23             Rectangle {
24                 anchors.centerIn: parent
25                 width: 60
26                 height: 60
27                 color: name 
28             }
29         }
30     }
31     ListView {
32         anchors.fill: parent
33         model: model
34         delegate: delegate
35     }
36 }