lqml/examples/Qt6/meshtastic/qml/ext/common/Hourglass.qml
pls.153 dc29ac9084 add Qt6 version of some examples (see below); revisions
'9999', 'advanced-qml-auto-reload', 'planets', 'sokoban'
2024-10-22 13:27:56 +02:00

42 lines
1.1 KiB
QML

import QtQuick
Rectangle {
anchors.fill: parent
color: "#ccebc5"
visible: animation.running
Image {
id: hourglass1
anchors.centerIn: parent
width: 40
fillMode: Image.PreserveAspectFit
source: "../../img/hourglass.png"
}
Image {
id: hourglass2
anchors.centerIn: parent
width: hourglass1.width
fillMode: Image.PreserveAspectFit
source: "../../img/hourglass.png"
opacity: 0
}
SequentialAnimation {
id: animation
objectName: "hourglass"
loops: Animation.Infinite
running: true
RotationAnimation { target: hourglass1; from: 0; to: 180; duration: 1000; easing.type: Easing.InOutSine }
ParallelAnimation {
NumberAnimation { target: hourglass1; property: "opacity"; from: 1; to: 0; duration: 1500; easing.type: Easing.InOutSine }
NumberAnimation { target: hourglass2; property: "opacity"; from: 0; to: 1; duration: 1500; easing.type: Easing.InOutSine }
}
// reset
NumberAnimation { target: hourglass1; property: "opacity"; to: 1; duration: 0 }
NumberAnimation { target: hourglass2; property: "opacity"; to: 0; duration: 0 }
}
}