parent
c563968003
commit
91241f9284
4 changed files with 43 additions and 2 deletions
@ -0,0 +1,27 @@ |
|||||||
|
import QtQuick 2.1 |
||||||
|
|
||||||
|
Rectangle { |
||||||
|
id: rectangle |
||||||
|
color: "red" |
||||||
|
width: 200 |
||||||
|
height: 200 |
||||||
|
|
||||||
|
Text { |
||||||
|
id: text |
||||||
|
text: "This is QML code.\n(Click to pause)" |
||||||
|
font.pointSize: 14 |
||||||
|
anchors.centerIn: parent |
||||||
|
PropertyAnimation { |
||||||
|
id: animation |
||||||
|
target: text |
||||||
|
property: "rotation" |
||||||
|
from: 0; to: 360; duration: 5000 |
||||||
|
loops: Animation.Infinite |
||||||
|
} |
||||||
|
} |
||||||
|
MouseArea { |
||||||
|
anchors.fill: parent |
||||||
|
onClicked: animation.paused ? animation.resume() : animation.pause() |
||||||
|
} |
||||||
|
Component.onCompleted: animation.start() |
||||||
|
} |
Loading…
Reference in new issue