Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.5, 6.7, 6.8
Description
In Qt Quick Controls 1, StackView QML Type had a method completeTransition() that
Immediately completes any ongoing transition.
void completeTransition()
https://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html#completeTransition-method
In Qt Quick Controls 2, completeTransition() was removed, and there is no replacement.
This prevents users from implementing a featur to cancel animation, in case the animation is played by a Transition in a StackView.
For example :
StackView {
id: stack
initialItem: mainView
anchors.top: btn.bottom
width: parent.width
height: 500
pushEnter: Transition {
id: pushEnterTrans
onRunningChanged: {
console.log(`pushEnter transition is running: ${running}`)
}
PropertyAnimation {
id: pushEnterAnim
property: "y"
from: (stack.mirrored ? -1 : 1) * stack.height
to: 0
duration: 2000
easing.type: Easing.OutCubic
Component.onCompleted: {
console.log(`pushEnter animator is running: ${running}`)
}
onRunningChanged: {
console.log(`pushEnter animator is running: ${running}`)
}
}
}
}
pushEnterAnim.complete() does not work here because pushEnterAnim.running never become true during the animation, while pushEnterTrans.running becomes true.
A replacement API for completeTransition() is needed for backwards compatibility.