风车
import QtQuick 2.9
import QtQuick.Window 2.2
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
Image{
anchors.fill: parent
id :background
source: "../images/background.png"
Image{
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
id:pole
source: "../images/pole.png"
}
Image {
anchors.centerIn: parent
id: wheel
source: "../images/pinwheel.png"
Behavior on rotation {
NumberAnimation{
duration: 500
}
}
}
MouseArea{
anchors.fill: parent
onClicked: wheel.rotation+=360
}
}
}