Qt 顺序动画中ScaleAnimator后的PropertyAction
当项目进入“选定”状态时,动画将正常工作。但当元素从“选定”状态通过时,只会触发ScaleAnimator 为什么PropertyAction会失败Qt 顺序动画中ScaleAnimator后的PropertyAction,qt,qml,qt5,qtquick2,qt-quick,Qt,Qml,Qt5,Qtquick2,Qt Quick,当项目进入“选定”状态时,动画将正常工作。但当元素从“选定”状态通过时,只会触发ScaleAnimator 为什么PropertyAction会失败 import QtQuick 2.7 import QtGraphicalEffects 1.0 Item { id: item width: 200 height: 200 Rectangle { id: rect color: "red" anchors.fi
import QtQuick 2.7
import QtGraphicalEffects 1.0
Item {
id: item
width: 200
height: 200
Rectangle {
id: rect
color: "red"
anchors.fill: parent
}
onZChanged: console.log(z)
states: State {
name: "SELECTED"
when: mouseArea.containsMouse
PropertyChanges { target: rect; color: "blue" }
}
transitions: [
Transition {
to: "SELECTED"
SequentialAnimation {
PropertyAction {//work fine
target: item
property: "z"
value: 1
}
ScaleAnimator {//work fine
target: rect
from: 1
to: 1.25
}
}
},
Transition {
from: "SELECTED"
SequentialAnimation {
ScaleAnimator {//work fine
target: rect
from: 1.25
to: 1
}
PropertyAction {//not work
target: item
property: "z"
value: 0
}
}
}
]
MouseArea {
id: mouseArea
anchors.fill: rect
hoverEnabled: true
}
}
In logs将只将z更改为1。它在Qt 5.6和5.9上工作,我在Qt 5.7上尝试它也在5.7.1上工作here@GrecKoZ顺序更改为0?是的,它确实更改为0