Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.14.2
-
-
838b9ee9f (dev), bc02757b1 (6.5), 2ec9fac28 (tqtc/lts-6.2)
Description
StackView's onDepthChanged does not execute after calling clear() if Transition been specified. If I do call clear() without parameters then onDepthChanged executes (depth become 0) as expected.
import QtQuick 2.14 import QtQuick.Controls 2.14 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") Rectangle { color: "yellow" anchors.fill: parent Button { text: "push green view" anchors.centerIn: parent onClicked: { stackView.push(swipeComponent) } width: 300 height: 100 } } StackView { anchors.fill: parent id: stackView onDepthChanged: { print("depth changed to " + depth) } } Component { id: swipeComponent Rectangle { color: "green" Button { text: "pop green view" anchors.centerIn: parent onClicked: { // NOTE: If you do swipeView.clear() then you can see log message "depth changed to 0" // But if you do swipeView.clear(StackView.PopTransition) then you can't stackView.clear(StackView.PopTransition) } } } } }