From 28cb75b73d3d0fa4cd8dcf3aa5884e93cb13a5d2 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 30 Aug 2019 12:38:25 +0200 Subject: Map: explicitly reload selected map on click When clicking on a flag 1) The QML would call MapLocationModel::setSelected() with fromClick = true 2) MapLocationModel::setSelected() would emit a signal selectedLocationChanged() 3) MapWidgetHelper would catch that signal and do the actual processing. Other functions would call MapLocationModel::setSelected() with fromClick = false, which would not emit the selectedLocationChanged() signal. Detangle this a bit by calling the selectedLocationChanged() function directly from QML and remove the fromClick parameter. Signed-off-by: Berthold Stoeger --- map-widget/qml/MapWidget.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'map-widget/qml') diff --git a/map-widget/qml/MapWidget.qml b/map-widget/qml/MapWidget.qml index 602b7c338..42fc0ab88 100644 --- a/map-widget/qml/MapWidget.qml +++ b/map-widget/qml/MapWidget.qml @@ -69,8 +69,10 @@ Item { drag.target: (mapHelper.editMode && mapHelper.model.isSelected(model.divesite)) ? mapItem : undefined anchors.fill: parent onClicked: { - if (!mapHelper.editMode && model.divesite) - mapHelper.model.setSelected(model.divesite, true) + if (!mapHelper.editMode && model.divesite) { + mapHelper.model.setSelected(model.divesite) + mapHelper.selectedLocationChanged(model.divesite) + } } onDoubleClicked: map.doubleClickHandler(mapItem.coordinate) onReleased: { -- cgit v1.2.3-70-g09d2