import QtQuick 2.14 import QtQuick.Window 2.14 Window { visible: true width: 1600 height: 900 title: qsTr("Hello World") Rectangle { id: rect width: 200 height: 200 color: "red" anchors.centerIn: parent } NumberAnimation { id: anim target: rect property: "opacity" to: 0; duration: 1500 Component.onCompleted: start() onFinished: anim2.start() } NumberAnimation { id: anim2 target: rect property: "opacity" to: 1; duration: 1500 onFinished: anim.start() } }