[Qt-qml] Repeater inside delegate ?

Stephen Collyer scollyer at netspinner.co.uk
Wed Jul 28 12:34:12 CEST 2010


Given a model like so:

    ListModel
    {
        id: people_model

        ListElement
        {
            name: "John Smith"
            role: "manager"
            age: 36
        }
     ...
    }

I'd like to have a delegate with a Repeater that accesses the various
properties of the model in some order:

    Component
    {
        id: people_delegate
        Item
        {
            Row
            {
                Repeater
                {
                    Rectangle
                    {
                        width: parent.width/3
                        Text
                        {
                            text: <the next property in the model>
                            color: "white"
                        }
                    }
                }

It's not clear to me if I can access named properties of the model
inside a Repeater, however. Is this possible ?

Given that the Repeater doesn't know which model it's working on,
I can't see how this could be done at present, but it strikes me
as potentially useful.

-- 
Stephen Collyer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100728/90a26276/attachment.html 


More information about the Qt-qml mailing list