summaryrefslogtreecommitdiffstats
path: root/examples/declarative/gridview/gridview-example.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/gridview/gridview-example.qml')
-rw-r--r--examples/declarative/gridview/gridview-example.qml19
1 files changed, 15 insertions, 4 deletions
diff --git a/examples/declarative/gridview/gridview-example.qml b/examples/declarative/gridview/gridview-example.qml
index fd5f430..a5f41fb 100644
--- a/examples/declarative/gridview/gridview-example.qml
+++ b/examples/declarative/gridview/gridview-example.qml
@@ -1,7 +1,8 @@
import Qt 4.7
Rectangle {
- width: 300; height: 400; color: "white"
+ width: 300; height: 400
+ color: "white"
ListModel {
id: appModel
@@ -16,10 +17,19 @@ Rectangle {
Component {
id: appDelegate
+
Item {
width: 100; height: 100
- Image { id: myIcon; y: 20; anchors.horizontalCenter: parent.horizontalCenter; source: icon }
- Text { anchors.top: myIcon.bottom; anchors.horizontalCenter: parent.horizontalCenter; text: name }
+
+ Image {
+ id: myIcon
+ y: 20; anchors.horizontalCenter: parent.horizontalCenter
+ source: icon
+ }
+ Text {
+ anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
+ text: name
+ }
}
}
@@ -31,8 +41,9 @@ Rectangle {
GridView {
anchors.fill: parent
cellWidth: 100; cellHeight: 100
- model: appModel; delegate: appDelegate
highlight: appHighlight
focus: true
+ model: appModel
+ delegate: appDelegate
}
}