Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MouseArea inside MapQuickItem not clickable?

MouseArea inside MapQuickItem not clickable?

Scheduled Pinned Locked Moved Unsolved General and Desktop
mouseareaclickedqtlocationmapquickitem
2 Posts 2 Posters 1.8k Views
  • 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.
  • NandakishoreN Offline
    NandakishoreN Offline
    Nandakishore
    wrote on last edited by
    #1

    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
    0
    • S Offline
      S Offline
      Schluchti
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved