summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/declarative/repeater.qml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src/snippets/declarative/repeater.qml')
-rw-r--r--doc/src/snippets/declarative/repeater.qml53
1 files changed, 43 insertions, 10 deletions
diff --git a/doc/src/snippets/declarative/repeater.qml b/doc/src/snippets/declarative/repeater.qml
index 8b4d9cbc90..be5d62df11 100644
--- a/doc/src/snippets/declarative/repeater.qml
+++ b/doc/src/snippets/declarative/repeater.qml
@@ -39,19 +39,52 @@
**
****************************************************************************/
+//! [import]
import Qt 4.7
+//! [import]
-Rectangle {
- width: 220; height: 20; color: "white"
+Row {
-//! [0]
- Row {
- Rectangle { width: 10; height: 20; color: "red" }
- Repeater {
- model: 10
- Rectangle { width: 20; height: 20; radius: 10; color: "green" }
+//! [simple]
+Row {
+ Repeater {
+ model: 3
+ Rectangle {
+ width: 100; height: 40
+ border.width: 1
+ color: "yellow"
}
- Rectangle { width: 10; height: 20; color: "blue" }
}
-//! [0]
+}
+//! [simple]
+
+//! [index]
+Column {
+ Repeater {
+ model: 10
+ Text { text: "I'm item " + index }
+ }
+}
+//! [index]
+
+//! [modeldata]
+Column {
+ Repeater {
+ model: ["apples", "oranges", "pears"]
+ Text { text: "Data: " + modelData }
+ }
+}
+//! [modeldata]
+
+//! [layout]
+Row {
+ Rectangle { width: 10; height: 20; color: "red" }
+ Repeater {
+ model: 10
+ Rectangle { width: 20; height: 20; radius: 10; color: "green" }
+ }
+ Rectangle { width: 10; height: 20; color: "blue" }
+}
+//! [layout]
+
}