Selecting items by mouse click.
This commit is contained in:
@ -2,6 +2,7 @@ import QtQuick
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: myItem
|
id: myItem
|
||||||
|
required property int index
|
||||||
required property string name
|
required property string name
|
||||||
required property string info
|
required property string info
|
||||||
property int fontSize: 16
|
property int fontSize: 16
|
||||||
@ -16,4 +17,8 @@ Item {
|
|||||||
text: '<b>Info:</b> ' + myItem.info
|
text: '<b>Info:</b> ' + myItem.info
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: parent.ListView.view.currentIndex = parent.index
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ Page {
|
|||||||
id: page
|
id: page
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
id: listView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
focus: true
|
focus: true
|
||||||
clip: true
|
clip: true
|
||||||
|
|||||||
Reference in New Issue
Block a user