diff options
Diffstat (limited to 'src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml')
| -rw-r--r-- | src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml b/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml index 945641e37c..29f0f1f558 100644 --- a/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml +++ b/src/quick/doc/snippets/qml/repeaters/repeater-grid-index.qml @@ -5,19 +5,34 @@ import QtQuick Rectangle { - width: 400; height: 400; color: "black" + width: 400 + height: 400 + color: "black" Grid { - x: 5; y: 5 - rows: 5; columns: 5; spacing: 10 + x: 5 + y: 5 + rows: 5 + columns: 5 + spacing: 10 - Repeater { model: 24 - Rectangle { width: 70; height: 70 - color: "lightgreen" + Repeater { + model: 24 + Rectangle { + id: delegate - Text { text: index - font.pointSize: 30 - anchors.centerIn: parent } } + required property int index + + width: 70 + height: 70 + color: "lightgreen" + + Text { + text: delegate.index + font.pointSize: 30 + anchors.centerIn: parent + } + } } } } |
