From 0d333a910e3ae55e0d1e59522d8730f85f299de2 Mon Sep 17 00:00:00 2001 From: srcejon Date: Wed, 28 Feb 2024 12:34:03 +0000 Subject: [PATCH] Fix URLs on QT 6 map. --- plugins/feature/map/map/map.qml | 2 -- plugins/feature/map/map/map_6.qml | 17 +++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/feature/map/map/map.qml b/plugins/feature/map/map/map.qml index 577bd63f0..ba6b824cf 100644 --- a/plugins/feature/map/map/map.qml +++ b/plugins/feature/map/map/map.qml @@ -307,14 +307,12 @@ Item { anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton - //propagateComposedEvents: true // so links in Text work onClicked: { if (mouse.button === Qt.LeftButton) { selected = !selected if (selected) { mapModel.moveToFront(mapModelFiltered.mapRowToSource(index)) } - //mouse.accepted = false // propagate to text } else if (mouse.button === Qt.RightButton) { menuItems.clear() menus.clear() diff --git a/plugins/feature/map/map/map_6.qml b/plugins/feature/map/map/map_6.qml index a774e695c..08145323d 100644 --- a/plugins/feature/map/map/map_6.qml +++ b/plugins/feature/map/map/map_6.qml @@ -316,12 +316,6 @@ Item { height: text.height + 5 radius: 5 visible: mapTextVisible - Text { - id: text - anchors.centerIn: parent - text: mapText - textFormat: TextEdit.RichText - } MouseArea { anchors.fill: parent hoverEnabled: true @@ -417,6 +411,17 @@ Item { object.menu.removeItem(object) } } + } + } + // Have Text after MouseArea, so links can be clicked + Text { + id: text + anchors.centerIn: parent + text: mapText + textFormat: TextEdit.RichText + onLinkActivated: { + console.log("Link", link); + mapModel.link(link); } } }