Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.6
-
None
-
1cf60c89a8711103a37b0511f4e91ee28d984b45
Description
The following code will produce a error right before the instance of page2Component has been destroyed (when its transition finishes):
import QtQuick 2.6 import QtQuick.Window 2.2 import Qt.labs.controls 1.0 Window { visible: true StackView { anchors.fill: parent initialItem: page1Component Component { id: page1Component Rectangle { id: root Text { text: "Page 1" font.pixelSize: 40 anchors.centerIn: parent } Button { text: "Push" onClicked: root.StackView.view.push(page2Component) } } } Component { id: page2Component Rectangle { id: root Text { text: "Page 2" font.pixelSize: 40 anchors.centerIn: parent } property bool someBinding: root.StackView.view.currentItem === root Button { text: "Pop" onClicked: root.StackView.view.pop() } } } } }
StackView's attached properties should be available until the component is destroyed.
We can't make the same guarantee for pre-existing items that are pushed, but for components, it's nice to not have to add lots of null checks.