Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistview / data / listview-sections.qml
1 import QtQuick 1.0
2
3 Rectangle {
4     width: 240
5     height: 320
6     color: "#ffffff"
7     resources: [
8         Component {
9             id: myDelegate
10             Item {
11                 id: wrapper
12                 objectName: "wrapper"
13                 height: ListView.previousSection != ListView.section ? 40 : 20;
14                 width: 240
15                 Rectangle {
16                     y: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
17                     height: 20
18                     width: parent.width
19                     color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white"
20                     Text {
21                         text: index
22                     }
23                     Text {
24                         x: 30
25                         id: textName
26                         objectName: "textName"
27                         text: name
28                     }
29                     Text {
30                         x: 100
31                         id: textNumber
32                         objectName: "textNumber"
33                         text: number
34                     }
35                     Text {
36                         objectName: "nextSection"
37                         x: 150
38                         text: wrapper.ListView.nextSection
39                     }
40                     Text {
41                         x: 200
42                         text: wrapper.y
43                     }
44                 }
45                 Rectangle {
46                     color: "#99bb99"
47                     height: wrapper.ListView.previousSection != wrapper.ListView.section ? 20 : 0
48                     width: parent.width
49                     visible: wrapper.ListView.previousSection != wrapper.ListView.section ? true : false
50                     Text { text: wrapper.ListView.section }
51                 }
52             }
53         }
54     ]
55     ListView {
56         id: list
57         objectName: "list"
58         width: 240
59         height: 320
60         model: testModel
61         delegate: myDelegate
62         section.property: "number"
63     }
64 }