summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSukhyun Kim <sukhyun.kim@nokia.com>2012-06-13 11:38:08 +0900
committerQt by Nokia <qt-info@nokia.com>2012-07-24 02:28:51 +0200
commited3fd81309130caa38543a5d31b23ae71f859ec5 (patch)
tree7f8cdb3e37408d48095d6b95bb1829e1b21d62dc
parentfdd774dce1071a127408f47840e370baacfe22c9 (diff)
Update example about QML Data Model
When using ListView.view in a delegate, the id of child of delegate has to attach in front of ListView.view to access the model and its properties in some case. Change-Id: I92201b00ab7a401781860d5d264d4ad8026e4c38 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
-rw-r--r--doc/src/snippets/declarative/models/views-models-delegates.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/src/snippets/declarative/models/views-models-delegates.qml b/doc/src/snippets/declarative/models/views-models-delegates.qml
index 1229f8e2..b08fc4af 100644
--- a/doc/src/snippets/declarative/models/views-models-delegates.qml
+++ b/doc/src/snippets/declarative/models/views-models-delegates.qml
@@ -62,9 +62,10 @@ Rectangle {
Component {
id: fruitDelegate
Row {
- Text { text: " Fruit: " + name; color: ListView.view.fruit_color }
+ id: fruit
+ Text { text: " Fruit: " + name; color: fruit.ListView.view.fruit_color }
Text { text: " Cost: $" + cost }
- Text { text: " Language: " + ListView.view.model.language }
+ Text { text: " Language: " + fruit.ListView.view.model.language }
}
}