Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94092

On iOS, MouseArea embedded in MapPolyLine filters all click events inside bounding box

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.15.2
    • Location
    • None
    • iOS/tvOS/watchOS

    Description

      Observed behavior:

      • Deployment to iOS (either Simulator or real device).

      When using a MouseArea embedded in the MapPolyLine, anytime the mouse is clicked inside a bounding box defined by the MapPolyLine's extremities, the event does not propagate to an underlying mouse capture area, e.g. the Map's `MouseArea` in the below example.

      Expected behavior

      Clicks outside the green line, but inside the red box, should be passed to any underlying mouse capture areas, e.g. the Map's `MouseArea`. This has not been tested on platforms other than macOS and iOS.

      Reproducible minimum example

      This minimal case is adapted from the Minimal Map example, with only the addition of the MapPolyLine and the MouseArea

      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtLocation 5.15
      import QtPositioning 5.15
      
      Window {
          width: Qt.platform.os == "android" ? Screen.width : 512
          height: Qt.platform.os == "android" ? Screen.height : 512
          visible: true
      
          Plugin {
              id: mapPlugin
              name: "osm" // "mapboxgl", "esri", ...
              // specify plugin parameters if necessary
              // PluginParameter {
              //     name:
              //     value:
              // }
          }
      
          Map {
              anchors.fill: parent
              plugin: mapPlugin
              center: QtPositioning.coordinate(59.91, 10.75) // Oslo
              zoomLevel: 14
      
              MouseArea {
                  anchors.fill: parent
      
                  onClicked: {
                      console.log("Background clicked")
                  }
              }
      
              MapPolyline {
                  line.width: 20
                  line.color: 'green'
      
                  // Initially set the path
                  path: [
                      { latitude: 59.91, longitude: 10.75},
                      { latitude: 59.91-45, longitude: 10.75-45}
                  ]
      
                  MouseArea {
                      anchors.fill: parent
      
                      Rectangle {
                          anchors.fill: parent
                          color: "red"
                          opacity: .2
                      }
      
                      onClicked: {
                          console.log("Line clicked")
                      }
                  }
              }
          }
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paangele Paolo Angelelli
            kubark42_ Kenz Dale
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes