mirror of
https://github.com/stemoretti/BaseUI.git
synced 2025-05-25 07:10:23 -04:00
36 lines
731 B
QML
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
|
|
}
|
|
}
|