And ignore the duplicate 'outerDelegate' id below - that should only be in the 
Repeater, not the Component.

On 10/12/2010, at 3:09 PM, ext bea....@nokia.com wrote:

> Hi James,
> 
> On 10/12/2010, at 2:20 PM, ext Wei, Xiaohai wrote:
> 
>> Thanks. 
>> 
>> another question on nested listview. 
>> 
>> How can inner delegate get the index of current outer model index?
>> 
> 
> One way to do it is to add a property to each delegate of the outer view, 
> which holds the 'index' value of that the delegate. The index can then be 
> accessed by the inner view. E.g.
> 
> Component {
>    id: outerDelegate
> 
>    Repeater {
>        id: outerDelegate
>        property int outerIndex: index
> 
>        model: ...
>        delegate: Text { text: outerDelegate.outerIndex }
> 
>    }
> }
> 
> regards,
> 
> Bea
> _______________________________________________
> Qt-qml mailing list
> Qt-qml@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml

--
Bea Lam
Software Engineer
Nokia, Qt Development Frameworks


_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to