I want rectangle animation from y = 0; to y = baza.height - rect1.height. I follow examples, but with no effect. Can you tell me why?
My code is as follow:
import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
title: qsTr("Hello World")
visibility: Window.Maximized
Rectangle
{
id: baza
x: 0
y: 0
width: parent.width
height: parent.height
Rectangle
{
id: rect1
x: 0
y: 0
width: 9
height: 100
radius: width / 2
color: "blue"
//color: { if (width > 20) "blue"; else "red" }
//SequentialAnimation {
SequentialAnimation{
loops: Animation.Infinite
running: true
NumberAnimation { target: rect1; property: "y"; to: { baza.height - rect1.heigh; } duration: 3000 }
}
}
MouseArea
{
anchors.fill: baza
onClicked:
{
Qt.quit();
}
}
}
}
import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
Window {
visible: true
title: qsTr("Hello World")
visibility: Window.Maximized
Rectangle
{
id: baza
x: 0
y: 0
width: parent.width
height: parent.height
Rectangle
{
id: rect1
x: 0
y: 0
width: 9
height: 100
radius: width / 2
color: "blue"
//color: { if (width > 20) "blue"; else "red" }
//SequentialAnimation {
SequentialAnimation{
loops: Animation.Infinite
running: true
NumberAnimation { target: rect1; property: "y"; to: { baza.height - rect1.heigh; } duration: 3000 }
}
}
MouseArea
{
anchors.fill: baza
onClicked:
{
Qt.quit();
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks