【发布时间】:2015-06-23 09:12:21
【问题描述】:
在代码中,我定义了 State、Transition 和 RotationAnimation。
属性更改后,即rotation 设置为360 后,onClicked 处理程序被渲染为静音,并且在随后的MouseArea 单击后将不再播放动画。
这是我当前的代码:
Image{
id: logo
x: 29
source: "LSFO-IngeniiSymbol.png"
width: 70
height: 70
states: State {
name: "rotated" ; when: area.pressed
PropertyChanges {target: logo; rotation: 360 }
}
transitions: Transition {
RotationAnimation {
id: rotateanimate
duration: 1000
direction: RotationAnimation.Clockwise
}
}
MouseArea {
id: area
anchors.fill: parent
onClicked: {
logo.state = "rotated"
// pageloader.source = "HelpDoc.qml"
// pageloader.source = ""
// pageloader.source = "HelpDoc.qml"
}
}
}
【问题讨论】: