What about animation components such as SequentialAnimation, PropertyAnimation, ColorAnimation?
import QtQuick
import QtQuick.Controls
Page {
Rectangle { id: redrect; x: 50; y: 50; width: 100; height: 100; color: "red" }
Button {
x: 50; y: 200; text: "Animate"
onClicked: SequentialAnimation {
ScriptAction {
script: {
redrect.x = 50;
redrect.rotation = 0;
redrect.color = "red";
}
}
PropertyAnimation { target: redrect; property: "x"; to: 200 }
PropertyAnimation { target: redrect; property: "rotation"; to: 90 }
PropertyAnimation { target: redrect; property: "x"; to: 50 }
ColorAnimation { target: redrect; property: "color"; to: "green" }
}
}
}
You can Try it Online!