fix: crash when create project

This commit is contained in:
Roy Qu 2022-10-23 18:39:15 +08:00
parent f348f0782a
commit a42ec4e253
1 changed files with 9 additions and 0 deletions

View File

@ -1138,6 +1138,13 @@ void MainWindow::updateClassBrowserForEditor(Editor *editor)
return;
}
if (editor->inProject() && !mProject) {
//project is in creation
mClassBrowserModel.setCurrentFile(editor->filename());
return;
}
mClassBrowserModel.beginUpdate();
mClassBrowserModel.setParser(editor->parser());
if (editor->inProject()) {
@ -6197,6 +6204,8 @@ void MainWindow::on_actionNew_Project_triggered()
mProject->saveAll();
updateProjectView();
scanActiveProject(true);
Editor* editor = mEditorList->getEditor();
updateClassBrowserForEditor(editor);
}
pSettings->ui().setNewProjectDialogWidth(dialog.width());
pSettings->ui().setNewProjectDialogHeight(dialog.height());