Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.2, 6.5.0
-
None
Description
The PropertyAnimation seems to utilize old/wrong values for from/to if they are updated while the animation is running.
Minimal example (working case):
Rectangle { id: mainRect anchors.centerIn: parent implicitWidth: 200 implicitHeight: 25 clip: true color: "gray" Rectangle { id: movingRect height: mainRect.height width: mainRect.width / 4 color: "black" PropertyAnimation { target: movingRect property: "x" from: -movingRect.width to: movingRect.width * 4 duration: 2000 running: true loops: Animation.Infinite onFromChanged: console.warn("!!! from:", from) onToChanged: console.warn("!!! to:", to) } } width: 400 }
!!! from: -100 !!! to: 400
Broken case:
// ... // width: 400 Component.onCompleted: { Qt.callLater(() => { mainRect.width = 400; }); } // ...
!!! from: -50 !!! to: 200 !!! from: -100 !!! to: 400