Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

QML List fetches DisplayRole from model; how can I change that?

$
0
0
I have some QML (that I did not write and to be honest do not understand, but nonetheless need to maintain) code that looks a lot like this:     Item {         anchors {             fill: parent             margins: 30         }           List {             id: recentList             header: qsTr("Open Item")             model: recentModel             anchors {                 left: parent.left                 right: parent.right                 top: parent.top             } The recentModel is a proper QT model, and what gets displayed looks like the returned value from a call to data with the role parameter set to DisplayRole. I’d like it to fetch a different string, as if it was calling data with otherRole. I’ve been rooting around the QML documentation, but selecting with data role doesn’t seem to come up. Is it possible?

Viewing all articles
Browse latest Browse all 13965

Trending Articles