Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved MouseArea inside MapQuickItem not clickable?

    General and Desktop
    mousearea clicked qtlocation mapquickitem
    2
    2
    1534
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Nandakishore
      Nandakishore last edited by

      I am trying to add a popup on the map. The only signals work for mousearea are Entered and Exited. None other working.

      Here is my code

      import QtQuick 2.0
      import QtPositioning 5.5
      import QtLocation 5.5
      
      import "components" as Components
      
      Map{
          id: hereMap
          plugin: mapPlugin
          activeMapType:hereMap.supportedMapTypes[3]
          center{
      
              latitude: 41.8890477
              longitude: -87.6223297
          }
      
      
          zoomLevel: 16
          z: 1
      
      
      MapQuickItem {
              id: mapMarkerItem
              property string type
              anchorPoint.x: markerImage.width/2
              anchorPoint.y: markerImage.height
              coordinate: QtPositioning.coordinate(41.8890477, -87.6223297)
      
      
      
              sourceItem: Rectangle {
                  id:mapMarker
                  color: "white"
                  //state: "hideToolTip"
      
                  Image {
                      id: markerImage
                      source: "qrc:/images/images/map-marker.png"
                      width:40
                      fillMode: Image.PreserveAspectFit
      
                      MouseArea{
                          anchors.fill: parent
                          hoverEnabled: true
                          onClicked: {
                              console.log('clicked')
                          }
                          onDoubleClicked: {
                              console.log('double-clicked')
                          }
                          onPressed: {
                              console.log('pressed')
                          }
                          onEntered: {
                              console.log('Entered')
                          }
                          onExited: {
                              console.log('Exited')
                          }
      
                      }
                  }
              }
          }
      
      }
      
      
      1 Reply Last reply Reply Quote 0
      • S
        Schluchti last edited by

        I just stumbled accros the same odd behavior with Qt 5.7.1. However, the strange thing is, that it seems to be only a problem on android (on windows it's fine). Does anybody know if that's a (already reported) bug?

        Want to read more about Qt?

        https://gympulsr.com/blog/qt/

        Latest Article: https://gympulsr.com/blog/qt/2017/06/14/ios-background-music-qt.html

        1 Reply Last reply Reply Quote 0
        • First post
          Last post