ListElement refer ListModel



  • Hi

    I am trying to populate a ListView with a ListModel which id I get from the ListElement of another ListModel...see my simple example below.
    However it obviously doesn't work, since I'm asking for your support.
    How can make this work?

    Thanks in advance! :-)

    Like this:
    @
    ListModel {
    id: model1
    ListElement {
    modellink: "model2"
    }
    }

    ListModel {
    id: model2
    ListElement {
    something: "blabla"
    }
    }

    ListView {
    id: mylistview
    model: model1
    delegate: ListView {
    id: anotherlistview
    model: modellink
    delegate: Text {
    text: something
    }
    }
    }
    @

    [Edit: Added @ tags around code and changed formatting for legibility -- mlong]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.