0

我在 QML 中有一个页面,并且我已经为这个页面上的后退按钮实现了一个新的逻辑(函数 back())。现在我想要,这个逻辑也将在从屏幕上滑动页面后运行。最好的方法是什么?onPeekEnded 事件不适合这种情况,因为它也会在取消滑动时触发。谢谢。

paneProperties: NavigationPaneProperties {
        backButton: ActionItem {
            onTriggered: {
                back();
            }
        }

    }
4

1 回答 1

0

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.

于 2013-06-18T19:49:21.100 回答