I want to access ListView current item data, but I haven't a clue how to do it. This is my code:
Here is my problem: The click works just find and I get the proper value, but when I try to automatically go to the next index/item, I cannot access the data value. How could I do that?Code:Item { id: root width: parent.width property int selectedIndex: -1 property alias model: itemList.model property alias count: itemList.count property alias currentIndex: itemList.currentIndex property alias currentItem: itemList.currentItem Component { id: defaultDelegate Item { id: delegateItem property bool selected: index == selectedIndex; MouseArea { id: delegateMouseArea anchors.fill: parent onPressed: selectedIndex = index; onClicked: console.debug("Name: " + name) } Text { id: itemText text: name } } } ListView { id: itemList anchors.fill: parent model: myModel delegate: defaultDelegate clip: true focus: true } }
The myModel is from a SQLite table using QSqlTableModel in C++.
Cheers![]()



