Selecting items by mouse click.
This commit is contained in:
@ -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: '<b>Info:</b> ' + myItem.info
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: parent.ListView.view.currentIndex = parent.index
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ Page {
|
||||
id: page
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
clip: true
|
||||
|
||||
Reference in New Issue
Block a user