Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

ListView, delegate; strange behaviour after repaint

$
0
0
Sorry, I wasn’t clear. The delegates cannot be stored (they’re managed by the listview). But state-information associated with a delegate could be stored. pseudocode below: Item {     id: root     property var stateInformation: []       ListView {         model: someModel         delegate: deleg     }       Component {         id: deleg         Rectangle {             property bool isRed: root.stateInformation[index] === true ? true : false             color: isRed ? "red" : "blue"             onColorChanged: {                 var si = root.stateInformation                 si[index] = isRed                 root.stateInformation = si             }               MouseArea {                 anchors.fill: parent                 onClicked: {                     if (parent.isRed) {                         parent.isRed = false                     } else {                         parent.isRed = true                     }                 }              }         }     } }

Viewing all articles
Browse latest Browse all 4972

Latest Images

Trending Articles



Latest Images