equal
deleted
inserted
replaced
|
1 import Qt 4.7 |
|
2 |
|
3 Item { |
|
4 |
|
5 ListModel { |
|
6 id: model |
|
7 ListElement { |
|
8 name: "Bill Smith" |
|
9 number: "555 3264" |
|
10 } |
|
11 ListElement { |
|
12 name: "John Brown" |
|
13 number: "555 8426" |
|
14 } |
|
15 ListElement { |
|
16 name: "Sam Wise" |
|
17 number: "555 0473" |
|
18 } |
|
19 ListElement { |
|
20 name: "Bob Brown" |
|
21 number: "555 5845" |
|
22 } |
|
23 } |
|
24 |
|
25 Component { |
|
26 id: highlight |
|
27 Rectangle { |
|
28 objectName: "highlight" |
|
29 width: 80; height: 80 |
|
30 color: "lightsteelblue"; radius: 5 |
|
31 y: grid.currentItem.y |
|
32 x: grid.currentItem.x |
|
33 } |
|
34 } |
|
35 |
|
36 GridView { |
|
37 id: grid |
|
38 objectName: "grid" |
|
39 anchors.fill: parent |
|
40 model: model |
|
41 delegate: Text { objectName: "wrapper"; text: name; width: 80; height: 80 } |
|
42 |
|
43 highlight: highlight |
|
44 highlightFollowsCurrentItem: false |
|
45 focus: true |
|
46 } |
|
47 |
|
48 } |