Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.0
- Rectangle {
- id: root
- width: 600
- height: 400
- color: "black"
- Rectangle{
- anchors.centerIn: parent
- width: parent.width / 4
- height: parent.height / 2
- // clip: true
- SequentialAnimation on width {
- loops: Animation.Infinite
- NumberAnimation { to: root.width / 2; duration: 1000 }
- NumberAnimation { to: root.width / 4; duration: 1000 }
- PauseAnimation { duration: 250 }
- }
- SequentialAnimation on height {
- loops: Animation.Infinite
- PauseAnimation { duration: 250 }
- NumberAnimation { to: root.height / 4; duration: 1000 }
- NumberAnimation { to: root.height / 2; duration: 1000 }
- }
- GradientEx{
- id: grad
- gradient: Gradient{
- GradientStop { position: 0.0; color: "red" }
- GradientStop { position: 0.33; color: "yellow" }
- GradientStop { position: 1.0; color: "green" }
- }
- // rotation: (2 * (parent.x - 400)) % 360
- NumberAnimation on rotation { from: 0; to: 360; duration: 5000; loops: Animation.Infinite }
- }
- //ちゃんとグラデの四角が良いサイズになってるか確認する用の四角(親のclipは解除して確認する)
- Rectangle{
- anchors.fill: parent
- opacity: 0.5
- }
- }
- Text{
- text: "angle=" + grad.rotation
- color: "white"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement