Hi,
I want to rotate an Image if a property is true. This is easy like this
RotationAnimator on rotation {
id: rotationAnimatorIconConnectionStatus
target: iconConnectionStatus
running: isConnectorWorking
loops: Animation.Infinite
duration: 2000
from: 0 ; to: 360
}
RotationAnimator on rotation {
id: rotationAnimatorIconConnectionStatus
target: iconConnectionStatus
running: isConnectorWorking
loops: Animation.Infinite
duration: 2000
from: 0 ; to: 360
}
To copy to clipboard, switch view to plain text mode
But this starts the RotationAnimation always from "0" if the running state changes. I want to rotate it from the last roation spot
I tried following but that doesnt work. Calling pause will not pause the Animation. it keeps running (Stopping would work but again the Rotation will be start from 0 again)
onIsConnectorWorkingChanged :{
if(isConnectorWorking) {
if(rotationAnimatorIconConnectionStatus.paused){
console.log("resume");
rotationAnimatorIconConnectionStatus.resume();
}
else{
console.log("start");
rotationAnimatorIconConnectionStatus.start();
}
}
else {
console.log("pause");
rotationAnimatorIconConnectionStatus.pause();
}
}
RotationAnimator on rotation {
id: rotationAnimatorIconConnectionStatus
target: iconConnectionStatus
running: false
loops: Animation.Infinite
duration: 2000
from: 0 ; to: 360
}
onIsConnectorWorkingChanged :{
if(isConnectorWorking) {
if(rotationAnimatorIconConnectionStatus.paused){
console.log("resume");
rotationAnimatorIconConnectionStatus.resume();
}
else{
console.log("start");
rotationAnimatorIconConnectionStatus.start();
}
}
else {
console.log("pause");
rotationAnimatorIconConnectionStatus.pause();
}
}
RotationAnimator on rotation {
id: rotationAnimatorIconConnectionStatus
target: iconConnectionStatus
running: false
loops: Animation.Infinite
duration: 2000
from: 0 ; to: 360
}
To copy to clipboard, switch view to plain text mode
Any suggestions?
THANKS!
Bookmarks