Skip to content

Instantly share code, notes, and snippets.

@amfasis
Created September 11, 2019 08:10
Show Gist options
  • Save amfasis/62181f1efcd0b3a2168b5903913a484c to your computer and use it in GitHub Desktop.
Save amfasis/62181f1efcd0b3a2168b5903913a484c to your computer and use it in GitHub Desktop.
compiz like page transition
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Rectangle {
width: 100; height: 100
anchors.centerIn: parent
color: "#00FF00"
Rectangle {
color: "#FF0000"
width: 10; height: 10
anchors.top: parent.top
anchors.right: parent.right
}
transform: [
Rotation {
id: yRot
origin.x: 50; origin.y: 50;
angle: 0
axis { x: 0; y: 1; z: 0 }
},
Translate {
x: Math.sin(Math.PI * yRot.angle / 180) * 100
}
]
NumberAnimation {
running: true
loops: 1
target: yRot;
property: "angle";
from: 0; to: 90;
duration: 4000;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment