BaseUI/qml/AppStackPage.qml
Stefano Moretti 11606b8f39 Heavy changes
2023-04-21 18:07:17 +02:00

36 lines
731 B
QML

import QtQuick
import QtQuick.Controls
Page {
id: root
readonly property StackView stack: StackView.view
property alias appToolBar: appToolBar
property alias leftButton: appToolBar.leftButton
property alias rightButtons: appToolBar.rightButtons
function pop(item, operation) {
if (root.stack.currentItem != root)
return false
return root.stack.pop(item, operation)
}
function back() {
pop()
}
Keys.onBackPressed: function(event) {
if (root.stack.depth > 1) {
event.accepted = true
back()
} else {
Qt.quit()
}
}
AppToolBar {
id: appToolBar
title: root.title
}
}