i have got a page in QML and i have implemented a new logic (function back()) for back button on this page. now I want, that this logic would also run after swiping the page from the screen. What is the best way to do it? onPeekEnded event is not suitable for this situation, because it fires also when the swiping was canceled. Thanks.
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
back();
}
}
}
When you push a new page to the screen using a NavigationPane, a onPopTransitionEnded() signal is fired after the page is dismissed, either by the back button or because the user swiped it away. You can add a slot for that signal to your controller, and put your logic there.
There is no need to implement manual back button functionality here. You get all of that for free.