79353649

Date: 2025-01-13 23:24:21
Score: 0.5
Natty:
Report link

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!

RedAnim.png

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): What
  • High reputation (-2):
Posted by: Stephen Quan