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. Making the border of a Mappolygon clickable
Forum Update on Monday, May 27th 2025

Making the border of a Mappolygon clickable

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 234 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.
  • saitejS Offline
    saitejS Offline
    saitej
    wrote on last edited by
    #1

    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

    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