Synchronize ListViews



  • I'm trying to synchronize a couple of ListViews. I have a global property "globalContentY" which is bound to
    @
    property int globalContentY: panel.children.length > 0 && panel.flickedView!== -1 && panel.children[panel.flickedView] !== undefined ? panel.children[panel.flickedView].listContentY : 0
    @
    "panel" is the item which contains the ListViews and "flickedView" is the index of the ListView which was flicked.
    "listContentY" is just an alias for listView.contentY
    @
    property alias listContentY: listView.contentY
    @

    Now I'm trying to bind the contentY of each ListView to the globalContentY
    @
    contentY: if(getIndex() != panel.flickedView) {panel.globalContentY}
    @

    I'm getting the error "Unable to assign [undefined] to double contentY", which is clear to me, because I don't assign anything when I'm setting the contentY of the flicked view.
    I don't know what I should do about that problem, because when I assign contentY in the else, the flicking does not work anymore (the column is just moving a bit)
    Can somebody help me or does anybody have an idea about a better solution?


Log in to reply
 

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