qml如何让listview中的item变为可编辑状态,就是双击点中就可以在item中写入新的内容。

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变成可编辑

放一个输入框visible设置为false,双击时设置为true