import QtQuick 2.2
Rectangle{
id: rootItem
width: 360
height: 360
color: "#cfcfcf"
Rectangle{
id: rect
width: 50
height: 50
x: 0
y: 5
color: "#c0c0ff"
MouseArea{
id: mouseArea
anchors.fill: parent
onClicked: {
animation.newHeight = 60
animation.start()
}
}
ParallelAnimation{
id: animation
property int newHeight: 240
NumberAnimation{
target: rootItem
properties: "height"
to: animation.newHeight
duration: 300
}
NumberAnimation{
target: rootItem
properties: "y"
to: y + (height-animation.newHeight)*0.5
duration: 300
}
}
}
}