From 4aa1c4373d8bddbb3a889334ea50a2fc599573c6 Mon Sep 17 00:00:00 2001 From: Sukhyun Kim Date: Wed, 13 Jun 2012 11:38:08 +0900 Subject: 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 --- doc/src/snippets/declarative/models/views-models-delegates.qml | 5 +++-- 1 file 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 } } } -- cgit v0.12