BorderImage: switch between half and full opacity
I want to toggle a BorderImage between half and full opacity. For now I have used a SequentialAnimation:
- BorderImage {
- id: softkeyImage
- source: "images/image.png"
- SequentialAnimation {
- running: softkey.state == "fadeoutin"
- NumberAnimation { target: softkeyImage; property: "opacity"; to: 0.5; duration: 1000 }
- NumberAnimation { target: softkeyImage; property: "opacity"; to: 1; duration: 1000 }
- loops: Animation.Infinite
- }
- }
Because our embedded device is too slow I want to remove the animation and just switch between half and full opacity. How to do this easily?
4 replies
Hello,
you can achieve this by using states [doc.qt.nokia.com]
You only start an animation using property binding. But in you case I think this is better. Try this:
- SequentialAnimation {
- running: softkey.state == "fadeoutin"
- PropertyAction { target: softkeyImage; property: "opacity"; value: 0.5 }
- PauseAnimation { duration: 1000 }
- PropertyAction { target: softkeyImage; property: "opacity"; value: 1 }
- PauseAnimation { duration: 1000 }
- loops: Animation.Infinite
- }
You must log in to post a reply. Not a member yet? Register here!
