summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2019-12-18 22:11:38 +0100
committerpaolo <paolo.angelelli.qt@gmail.com>2020-01-18 14:38:06 +0100
commit1bba966b8df1cc1d39276833ff4533f967df247e (patch)
tree4a7145b75fb3284c56392368ae90cff597e2407e
parenta5e677741a9cbc8b257a58a2ffe3c5f5ee785152 (diff)
downloadqtlocation-1bba966b8df1cc1d39276833ff4533f967df247e.tar.gz
Add to GeoJsonDelegate.qml support for logging clicked country
Change-Id: I15f7cae7efc58279d76e9ac7d0be3b7fd63ae1cd Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--examples/location/geojson_viewer/GeoJsonDelegate.qml11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/location/geojson_viewer/GeoJsonDelegate.qml b/examples/location/geojson_viewer/GeoJsonDelegate.qml
index d3e8db93..ff0fbffa 100644
--- a/examples/location/geojson_viewer/GeoJsonDelegate.qml
+++ b/examples/location/geojson_viewer/GeoJsonDelegate.qml
@@ -98,6 +98,17 @@ DelegateChooser {
opacity: dc.defaultOpacity
color: (props && props.color) || (parent && parent.props && parent.props.color) || dc.defaultColor
border.width: 0
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ if (props !== undefined)
+ console.log(props.name)
+ else if (parent.parent.geojsonType == "MultiPolygon")
+ console.log(parent.parent.props.name)
+ else
+ console.log("NO NAME!", props)
+ }
+ }
}
}