diff --git a/ListItemDelegate.qml b/ListItemDelegate.qml index eee6822..19b481c 100644 --- a/ListItemDelegate.qml +++ b/ListItemDelegate.qml @@ -2,6 +2,7 @@ import QtQuick Item { id: myItem + required property int index required property string name required property string info property int fontSize: 16 @@ -16,4 +17,8 @@ Item { text: 'Info: ' + myItem.info } } + MouseArea { + anchors.fill: parent + onClicked: parent.ListView.view.currentIndex = parent.index + } } diff --git a/ListPage.qml b/ListPage.qml index 3402adb..0871b2d 100644 --- a/ListPage.qml +++ b/ListPage.qml @@ -6,6 +6,7 @@ Page { id: page ListView { + id: listView anchors.fill: parent focus: true clip: true