Skip to content

Commit

Permalink
[qt6][qml] Push Application on the stack before loading the project
Browse files Browse the repository at this point in the history
This prevents crashes when the project is done loading but
`Application` is not yet ready.
  • Loading branch information
cbentejac committed Oct 2, 2024
1 parent 41fbca0 commit 9865cb8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions meshroom/ui/qml/Homepage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ Page {
Connections {
target: projectDelegate
function onClicked() {
if (!modelData["path"]){
if (!modelData["path"]) {
initFileDialogFolder(openFileDialog)
openFileDialog.open()
} else{
} else {
// Open project
mainStack.push("Application.qml")
if (_reconstruction.loadUrl(modelData["path"])) {
Expand Down
6 changes: 3 additions & 3 deletions meshroom/ui/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ ApplicationWindow {
title: "Open File"
nameFilters: ["Meshroom Graphs (*.mg)"]
onAccepted: {
if (_reconstruction.loadUrl(currentFile)) {
MeshroomApp.addRecentProjectFile(currentFile.toString())
}
if (mainStack.currentItem instanceof Homepage) {
mainStack.push("Application.qml")
}
if (_reconstruction.loadUrl(currentFile)) {
MeshroomApp.addRecentProjectFile(currentFile.toString())
}
}
}

Expand Down

0 comments on commit 9865cb8

Please sign in to comment.