summaryrefslogtreecommitdiffstats
path: root/doc/src
diff options
context:
space:
mode:
authorSukhyun Kim <sukhyun.kim@nokia.com>2012-06-13 02:38:08 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-06-13 07:41:18 (GMT)
commit4aa1c4373d8bddbb3a889334ea50a2fc599573c6 (patch)
tree03c005635d365e3d485619ad3c27fce0d8e95d5e /doc/src
parentb22fdf72aed1d6ab5e073f6cd1eee26de59a5b4f (diff)
downloadQt-4aa1c4373d8bddbb3a889334ea50a2fc599573c6.zip
Qt-4aa1c4373d8bddbb3a889334ea50a2fc599573c6.tar.gz
Qt-4aa1c4373d8bddbb3a889334ea50a2fc599573c6.tar.bz2
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>
Diffstat (limited to 'doc/src')
-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 1ad7c1e..9cc7c67 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 }
}
}