I have a fullscreen map, on which I added a mouse area:
Map {
id: map
anchors.fill: parent
plugin: osm
zoomLevel: 16
minimumZoomLevel: 13
maximumZoomLevel: 20
gesture.enabled: true
Rectangle {
id: infoPanel
// ...
Button {
// ...
}
}
MouseArea {
anchors.fill: parent
onPressed: {
infoPanel.visible = false
}
}
The infoPanel
rect will ocasionally be made visible, overlaying the map with some information, and a button to trigger a certain action.
Now I have added the mouse area to the map in order to hide the info panel whenever the map is clicked, which works fine.
However, the info panel is also dismissed when the rectangle of the info panel itself is clicked.
How can I prevent the mouse area from the map to interfere with anything which is inside infoPanel
?