PDA

View Full Version : Handle event when stackview pop



batmanvn
27th November 2017, 04:06
Hi,
I have stackview in main.qml. I use this stackview to push A.qml and in A.qml push to B.qml. I want to handle event in page A when page B pop look like Component.onCompleted
How to i do this?
Thanks!!!

batmanvn
27th November 2017, 04:08
Hi,
I develop a android app using Qt. I have a StackView in main.qml. I use this StackView push other page. I have page A, B, C, D...
Now, in main StackView push A page, in A push to B, in B push to C... ( A->B->C ) When in page C, I want to pop page A not B.
How to I do this?


main.qml

{
StackView {
id: stackView
anchors.fill: parent
}

Button { onClicked: stackView.push("qrc:/A.qml") }
}


A.qml
{
Button { onClicked: stackView.push("qrc:/B.qml") }
}

B.qml

{
Button { onClicked: stackView.push("qrc:/C.qml") }
}

C.qml
{
Button { onClicked: // I want to pop to page A not B }
}
Thanks!!!