QML:NumberAnimation 不能引用其父 SequentalAnimation
QML: NumberAnimation can't refer to its parent SequentalAnimation
我的代码:
import QtQuick 2.5
import QtQuick.Window 2.2
Window {
visible: true
width: 640
height: 480
property double angle: 0
SequentialAnimation on angle {
property int myDuration: 3000 // const
NumberAnimation {
from: -30.0
to: 30.0
duration: parent.myDuration
easing.type: Easing.InOutSine
}
}
}
我在“parent.myDuration
”行收到此错误:
ReferenceError: parent is not defined
有什么想法吗?
我的代码:
import QtQuick 2.5
import QtQuick.Window 2.2
Window {
visible: true
width: 640
height: 480
property double angle: 0
SequentialAnimation on angle {
property int myDuration: 3000 // const
NumberAnimation {
from: -30.0
to: 30.0
duration: parent.myDuration
easing.type: Easing.InOutSine
}
}
}
我在“parent.myDuration
”行收到此错误:
ReferenceError: parent is not defined
有什么想法吗?