我正在尝试为 Qml 地图上的方位属性更改设置动画:
Map {
id: map
Behavior on bearing {
enabled: true
RotationAnimation {
direction: RotationAnimation.Shortest
duration: 500
easing.type: Easing.Linear
}
}
Button {
onClicked: map.bearing = 100 // animation works. Map rotation is animated
}
Button {
onClicked: map.setBearing(100, Qt.point(10,10)) // animation does not work. Map rotates immediately to the bearing
}
}
当直接使用设置方位时map.bearing
,动画将起作用。但是当使用辅助方法时map.setBearing
,动画不起作用。有没有办法将动画与map.setBearing
方法一起获取?
问候,