ListView {
id: listView
anchors.fill: parent
anchors.margins: 20
model: myModel
delegate: myDelegate
highlightFollowsCurrentItem: true
focus: true
ListModel {
id: myModel
ListElement {
name: "Apple"; cost: 2.45
attributes: [
ListElement { description: "Core" },
ListElement { description: "Deciduous" }
]
isOnMouse: false
}
}
我用myDelegate爲默認任何模型,但如果被點擊的項目之一,我whant使用另一種委託這個項目,只是爲這個項目。
可能嗎?
我我回答了一個類似的問題:http://stackoverflow.com/questions/24784706/selecting-delegates-dependi NG-的屬性。也許它有幫助。 – mhcuervo 2014-07-17 16:12:57