Rename Qt Quick-specific classes to QQuick*
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qquickgridview / data / gridview1.qml
1 import QtQuick 2.0
2
3 Rectangle {
4     id: root
5     property int count: grid.count
6     property bool showHeader: false
7     property bool showFooter: false
8     property int added: -1
9     property variant removed
10
11     width: 240
12     height: 320
13     color: "#ffffff"
14     resources: [
15         Component {
16             id: myDelegate
17             Rectangle {
18                 id: wrapper
19                 objectName: "wrapper"
20                 width: 80
21                 height: 60
22                 border.color: "blue"
23                 property string name: model.name
24                 Text {
25                     text: index
26                 }
27                 Text {
28                     x: 40
29                     text: wrapper.x + ", " + wrapper.y
30                 }
31                 Text {
32                     y: 20
33                     id: textName
34                     objectName: "textName"
35                     text: name
36                 }
37                 Text {
38                     y: 40
39                     id: textNumber
40                     objectName: "textNumber"
41                     text: number
42                 }
43                 color: GridView.isCurrentItem ? "lightsteelblue" : "white"
44                 GridView.onAdd: root.added = index
45                 GridView.onRemove: root.removed = name
46             }
47         },
48         Component {
49             id: headerFooter
50             Rectangle { width: 30; height: 320; color: "blue" }
51         }
52     ]
53     GridView {
54         id: grid
55         objectName: "grid"
56         width: 240
57         height: 320
58         cellWidth: 80
59         cellHeight: 60
60         flow: (testTopToBottom == false) ? GridView.LeftToRight : GridView.TopToBottom
61         layoutDirection: (testRightToLeft == true) ? Qt.RightToLeft : Qt.LeftToRight
62         model: testModel
63         delegate: myDelegate
64         header: root.showHeader ? headerFooter : null
65         footer: root.showFooter ? headerFooter : null
66     }
67 }