Hello Friends,
I have this snippet here using in my program:
Rectangle {
id:intelliRect
width: 180; height: 300
visible: false
Component {
id: memberDelegate
Item {
width: 180; height: 20
Column {
Text {
text: '<b>' + modelData + '</b> '
font.pointSize: 10
font.family: "consolas"
renderType: Text.NativeRendering;
}
}
}
}
ListView {
id:intelliView
anchors.fill: parent
model: mymodel
delegate: memberDelegate
highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
focus: true
Keys.onPressed: {
if(event.key === 16777216) { //escape
console.log('Escape')
intelliRect.visible = false;
edit.focus = true;
}
if(event.key === 16777220) { // enter
}
}
Rectangle {
id:intelliRect
width: 180; height: 300
visible: false
Component {
id: memberDelegate
Item {
width: 180; height: 20
Column {
Text {
text: '<b>' + modelData + '</b> '
font.pointSize: 10
font.family: "consolas"
renderType: Text.NativeRendering;
}
}
}
}
ListView {
id:intelliView
anchors.fill: parent
model: mymodel
delegate: memberDelegate
highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
focus: true
Keys.onPressed: {
if(event.key === 16777216) { //escape
console.log('Escape')
intelliRect.visible = false;
edit.focus = true;
}
if(event.key === 16777220) { // enter
}
}
To copy to clipboard, switch view to plain text mode
My question is how can I access the current items text in the listview? There is currentItem, currentIndex etc but no text accessor..
Thanks
Bookmarks