deletegate代码如下:
Component {
id: template_Delegate
Item {
id: template_wrapper
width: parent.width
height: 30
TextEdit {
id: template_input
text: name
width: parent.width
height: 30
readOnly: true
anchors.left: parent.left
anchors.leftMargin: 10
anchors.top: parent.top
anchors.topMargin: 10
}
MouseArea{
anchors.fill: parent
onClicked: {
template_wrapper.ListView.view.currentIndex = index
}
onDoubleClicked: {
}
}
}
}
就是要让item中的text变成可编辑