equal
deleted
inserted
replaced
|
1 import Qt 4.7 |
|
2 |
|
3 Rectangle { |
|
4 id: root |
|
5 property int added: -1 |
|
6 property variant removed |
|
7 |
|
8 width: 240 |
|
9 height: 320 |
|
10 color: "#ffffff" |
|
11 resources: [ |
|
12 Component { |
|
13 id: myDelegate |
|
14 Rectangle { |
|
15 id: wrapper |
|
16 objectName: "wrapper" |
|
17 width: 80 |
|
18 height: 60 |
|
19 border.color: "blue" |
|
20 Text { |
|
21 text: index |
|
22 } |
|
23 Text { |
|
24 x: 40 |
|
25 text: wrapper.x + ", " + wrapper.y |
|
26 } |
|
27 Text { |
|
28 y: 20 |
|
29 id: textName |
|
30 objectName: "textName" |
|
31 text: name |
|
32 } |
|
33 Text { |
|
34 y: 40 |
|
35 id: textNumber |
|
36 objectName: "textNumber" |
|
37 text: number |
|
38 } |
|
39 color: GridView.isCurrentItem ? "lightsteelblue" : "white" |
|
40 GridView.onAdd: root.added = index |
|
41 GridView.onRemove: root.removed = name |
|
42 } |
|
43 } |
|
44 ] |
|
45 GridView { |
|
46 id: grid |
|
47 objectName: "grid" |
|
48 width: 240 |
|
49 height: 320 |
|
50 cellWidth: 80 |
|
51 cellHeight: 60 |
|
52 flow: (testTopToBottom == false) ? "LeftToRight" : "TopToBottom" |
|
53 model: testModel |
|
54 delegate: myDelegate |
|
55 } |
|
56 } |