From 7c962ceba942f3adf2a77424d73504608a6fceac Mon Sep 17 00:00:00 2001 From: Sukhyun Kim Date: Wed, 13 Jun 2012 13:47:28 +0900 Subject: [PATCH] Update example in a doc. There are "TypeError" errors. 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 this case. Change-Id: I4610f1fc8b0d085f7cba137e76e0578be7b51e23 Reviewed-by: Alan Alpert --- src/quick/doc/snippets/qml/models/views-models-delegates.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/quick/doc/snippets/qml/models/views-models-delegates.qml b/src/quick/doc/snippets/qml/models/views-models-delegates.qml index e9f8725..671d6c7 100644 --- a/src/quick/doc/snippets/qml/models/views-models-delegates.qml +++ b/src/quick/doc/snippets/qml/models/views-models-delegates.qml @@ -63,9 +63,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 } } } -- 2.7.4