I am using Qt Quick 2 and would like a QML image to be updated when the source is change via clicked on the image. But can't get that to happen.
There have been a few similiar questions but those solutions have not brought any joy in my case. Both images are added to the solution and I can set the image to either. Just can't update the image after changing the source.
Thanks in advance
Image {
id : two_player_button
x: 24
y: 105
cache : false
fillMode: Image.PreserveAspectCrop
z: 1
sourceSize.height: 0
sourceSize.width: 0
source: "resources/base/players_2.png"
MouseArea {
anchors.fill: parent
onClicked: {
source: "resources/base/players_2_hl.png"
//two_player_button.update()
}
}
}
I have also tried updating it via the parent.