I'm using QtQuick 2.0 and and a QML ListView to display some items, and I need to know when the user chooses a different item. Emitting a signal when the user clicks a mouse area in the delegate works, i.e.
MouseArea{
onClicked: {
controller.itemChanged(model.item);
someList.currentIndex = index;
}
}
but only if the user uses the mouse to choose the item, but it doesn't work if the user uses the arrow keys.
I've been looking through the docs to find what signal is emitted when the currentIndex
is changed, but I can't seem to find any. I'm looking for something similar to QListWidget::itemSelectionChanged()
but it seems QML ListView doesn't have that.
onCurrentIndexChanged
signal? All notifiable properties have theiron<name>Changed
property. – Arpegius