如何在SequentialAnimation中使用AnchorAnimation?

时间:2012-06-19 15:25:56

标签: animation qml

我想在顺序动画中将小部件移动到容器的中心,但它不起作用:

SequentialAnimation {
    PauseAnimation { duration: 1000 }
    AnchorAnimation {
        duration: 1000
        //  ERROR: Cannot assign to non-existent default property 
        AnchorChanges {
            target: widget1
            anchors.horizontalCenter: container.horizontalCenter
        }
    }
....

既不:

SequentialAnimation {
    PauseAnimation { duration: 1000 }
    // ERROR: Cannot assign object to list
    AnchorChanges {
        target: widget1
        anchors.horizontalCenter: container.horizontalCenter
    }
    AnchorAnimation {
        duration: 1000
    }
....

1 个答案:

答案 0 :(得分:0)

您无法将AnchorChanges项目放入动画中。您已将其置于状态定义中。

有关详细信息,请参阅documentation