I'm developing a little application with Qt5 and QML (QtCreator and C++).
I would like to display a map with countries and when user passes the mouse over a country I would like to change the color of the country, thought it would be easy, and it is if all countries were rectangles.
Image {
id: mycountry
width: 250
height: 250
source: "images/myCountry_gray.png"
MouseArea {
anchors.fill: parent
hoverEnabled : true
onEntered: {
region.source = "images/myCountry_red.png"
}
onExited: {
region.source = "images/myCountry_gray.png"
}
}
}
Unfortunately, countries have irregular shapes, and I would like only highlight the country when mouse cursor is inside its frontier
Have you some idea how to develop that? I think it won't be possible using QML alone.