Solved SequentialAnimation blinks in Qt 5.14 works as expected in Qt 5.13
-
Here is a small example code of a simple sequence animation, on mouse click a red box fades in, stays for almost a second and fades out.
The gif above shows what happens when compiled with Qt 5.13, an expected behaviour.
In Qt 5.14 the box blinks before it disappears as shown in the gif below. Is this a bug ?
The code run is as the following:
import QtQuick 2.13 Item { width: 360 height: 340 Rectangle { id: rootId visible: animationId.running height: 60 width: 60 color: "red" opacity: 0.0 anchors { top: parent.top topMargin: 76 horizontalCenter: parent.horizontalCenter } SequentialAnimation { id: animationId alwaysRunToEnd: false PropertyAnimation { target: rootId property: "opacity" to: "1.0" duration: 300 } PropertyAnimation { target: rootId property: "opacity" to: "1.0" duration: 800 } PropertyAnimation { target: rootId property: "opacity" to: "0.0" duration: 600 } } } MouseArea { anchors.fill : parent onClicked: animationId.restart() } }
-
It's a change of behaviour but your code is weird.
You use string value to assign a real number value.
Your second PropertyAnimation repeats the first one, it seems you added it just as a pause.Your animation wrote like this is clearer and works as intendend:
SequentialAnimation { id: animationId alwaysRunToEnd: false PropertyAnimation { target: rootId property: "opacity" to: 1 duration: 300 } PauseAnimation { duration: 800 } PropertyAnimation { target: rootId property: "opacity" to: 0 duration: 600 } }
-
@GrecKo said in SequentialAnimation blinks in Qt 5.14 works as expected in Qt 5.13:
SequentialAnimation {
id: animationId
alwaysRunToEnd: false
PropertyAnimation {
target: rootId
property: "opacity"
to: 1
duration: 300
}
PauseAnimation {
duration: 800
}
PropertyAnimation {
target: rootId
property: "opacity"
to: 0
duration: 600
}
}Thanks, that solves the issue in qt 5.14.
Not sure why the former method works in Qt 5.13, but something must have changed between versions.