examples/quick/views/pathview: utilize required properties

Change-Id: I07c5068de9330236b2e593d9995fdfda3e019006
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Maximilian Goldstein 2019-11-28 15:00:08 +01:00
parent 2a809ef657
commit 6efdefda28
1 changed files with 7 additions and 3 deletions

View File

@ -71,19 +71,23 @@ Rectangle {
width: 100; height: 100
scale: PathView.iconScale
required property string name
required property string icon
required property int index
Image {
id: myIcon
y: 20; anchors.horizontalCenter: parent.horizontalCenter
source: icon
source: parent.icon
}
Text {
anchors { top: myIcon.bottom; horizontalCenter: parent.horizontalCenter }
text: name
text: parent.name
}
MouseArea {
anchors.fill: parent
onClicked: view.currentIndex = index
onClicked: view.currentIndex = parent.index
}
}
}