Button state change causes freeze
Unsolved
QML and Qt Quick
-
Hello
I am trying to make a 3D button effect when you press the button. the way im doing this is by using states and properychanges. So basically I want to remove any shadow effect once the button is pressed.
Button { id: backButton onPressed: { backButton.state = "pressed" console.log("clicked") // console.log(shadow.horizontalOffset) } onReleased: { backButton.state = "released" console.log("released") //console.log(shadow.horizontalOffset) } layer.enabled: true layer.effect: DropShadow { id: shadow anchors.fill: backButton horizontalOffset: 2 verticalOffset: 2 samples: 7 radius: 3 color: "#000000" source: backbuttomimage } states: [ State { name: "pressed" PropertyChanges { target: shadow } }, State { name: "released" PropertyChanges { target: shadow } } ] background: Image { id: backbuttomimage smooth: true source: "qrc:/Icons/leftarrow.png" anchors.fill: backButton fillMode: Image.PreserveAspectFit } }``` When I click on the button, the whole GUI stops to function. I have tried a multiple different implementations, but they all yield the same issue.