Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Making the border of a Mappolygon clickable



  • Hi

    I have been trying to make the border of a mappolygon clickable by the following code:

    MapPolygon{
            id: _poly
            border.color: "black"
            border.width: 4
            color: "transparent"
            visible: false
            path: []
            MouseArea{
                id: _polyMousearea
                anchors.fill: _poly.border
                acceptedButtons: Qt.LeftButton
                onClicked: {
                    var coord = _map.toCoordinate(Qt.point(flightMapMouseArea.mouseX,flightMapMouseArea.mouseY))
    console.log(coord )
    
                    }
    
                }
            }
    
        }
    
    

    I get the following error:

    Unable to assign QDeclarativeMapLineProperties to QQuickItem

    Any way to get around this error and make the border clickable?

    Thanks


Log in to reply