Qml贴图的动画轴承特性更改

问题描述 投票:0回答:1

我正在尝试使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方法一起使用?

问候,

qt qml qtquick2 qtlocation
1个回答
0
投票

我敢打赌,您需要setBearing调用的另一个单独的动画。该行为中包含的行为无法覆盖您添加的用例,因为它在属性上运行,而严格来说,setBearing重载会绕过该属性,并且仅在完成后才触发更新的信号

© www.soinside.com 2019 - 2024. All rights reserved.