ApplicationWindow { id: appWindow StatusBar { id: statusBar property string backPressedState: backButtonPressed ? "Pressed" : "" anchors { top: parent.top left: parent.left right: parent.right } titleText: pageStack.currentPage === null ? "" : pageStack.currentPage.title showMenuIndicator: (pageStack.currentPage !== null) && (pageStack.currentPage.tools !== null) backButtonIconSource: (pageStack === null) || (pageStack.depth === 1) ? "image://theme/wmCloseIcon" + backPressedState : "image://theme/wmBackIcon" + backPressedState onTitleAreaClicked: menu.open() onBackClicked: (pageStack === null) || (pageStack.depth === 1) ? Qt.quit() : pageStack.pop() onBackPressAndHold: if ((pageStack !== null) && (pageStack.depth > 1)) pageStack.pop(null); } PageStack { id: pageStack anchors { top: statusBar.bottom left: parent.left right: parent.right bottom: parent.bottom } Component.onCompleted: push(Qt.resolvedUrl("HomePage.qml"), null, true) } Menu { id: menu tools: pageStack.currentPage === null ? null : pageStack.currentPage.tools } }