Something like this
Rectangle {
x: 50
...
NumberAnimation on x{
id: anim
running: true
to: 60
duration: 100
onStopped: {
if(anim.to===60) { anim.from=60; anim.to=50; } else { anim.from=50; anim.to=60 }
start()
}
}
}
↧