The everyday cruise of the sun in the sky starts in the east and continues west to hide beneath the horizon in the evening. Let's try to replicate this horizontal movement by adding animation to our sun object.
Open the QML document of our last project. Inside the root item, add the following declaration:
NumberAnimation { target: sun property: "x" from: 0 to: root.width duration: dayLength running: true}
Running the program with such modifications will produce a run with a horizontal movement of the sun. The following image is a composition of a number of frames of the run: