summaryrefslogtreecommitdiff
path: root/examples/location/places/views/CategoryDelegate.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/location/places/views/CategoryDelegate.qml')
-rw-r--r--examples/location/places/views/CategoryDelegate.qml27
1 files changed, 13 insertions, 14 deletions
diff --git a/examples/location/places/views/CategoryDelegate.qml b/examples/location/places/views/CategoryDelegate.qml
index 2ac0a339..75f7060e 100644
--- a/examples/location/places/views/CategoryDelegate.qml
+++ b/examples/location/places/views/CategoryDelegate.qml
@@ -45,15 +45,14 @@ import QtLocation 5.5
Item {
id: root
- property alias text: textItem.text
+ property alias text: labelItem.text
property bool checked: false
signal searchCategory()
- signal showSubcategory()
+ signal showSubcategories()
width: parent.width
- height: Math.max(icon.height, textItem.height * 2)
+ height: Math.max(icon.height, labelItem.height * 2)
- //! [CategoryModel delegate icon]
Image {
id: icon
anchors.left: parent.left
@@ -61,7 +60,6 @@ Item {
anchors.verticalCenter: parent.verticalCenter
source: category.icon.url()
}
- //! [CategoryModel delegate icon]
Rectangle {
anchors.fill: parent
@@ -71,12 +69,18 @@ Item {
//! [CategoryModel delegate text]
Label {
- id: textItem
+ id: labelItem
text: category.name
anchors.left: icon.right
anchors.verticalCenter: parent.verticalCenter
anchors.right: arrow.left
}
+
+ MouseArea {
+ id: mouse
+ anchors.fill: parent
+ onClicked: root.searchCategory()
+ }
//! [CategoryModel delegate text]
Rectangle {
@@ -86,13 +90,7 @@ Item {
height: 1
color: "#46a2da"
}
-
- MouseArea {
- id: mouse
- anchors.fill: parent
- onClicked: root.searchCategory()
- }
-
+ //! [CategoryModel delegate arrow]
ToolButton {
id: arrow
anchors.right: parent.right
@@ -100,6 +98,7 @@ Item {
anchors.rightMargin: 15
visible: model.hasModelChildren
iconSource: "../../resources/right.png"
- onClicked: root.showSubcategory()
+ onClicked: root.showSubcategories()
}
+ //! [CategoryModel delegate arrow]
}