Skip to content

Commit

Permalink
[ApplicationWindow] Add pop and replace functions
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Oct 22, 2023
1 parent c93440f commit b35a883
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/controls/qml/ApplicationWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ NemoWindow {
}
}

function pop() {
pageStack.pop()
}

function replace(url, params) {
if(!params){
params = {}
}

var component = Qt.createComponent(url)
if (component.status === Component.Ready) {
pageStack.push(component.createObject(pageStack, params))
} else {
console.warn("Error loading component", url, component.errorString())
pageStack.push(Qt.resolvedUrl("ErrorStackPage.qml"), {error: component.errorString()})
}
}

Timer {
id: _errorTimer
property string errorString
Expand Down

0 comments on commit b35a883

Please sign in to comment.