fix: crash when exit

This commit is contained in:
royqh1979@gmail.com 2021-11-01 23:37:54 +08:00
parent d27f8c1c50
commit afbaaa07a6
2 changed files with 9 additions and 2 deletions

View File

@ -152,8 +152,10 @@ bool EditorList::closeEditor(Editor* editor, bool transferFocus, bool force) {
updateLayout(); updateLayout();
if (!force) { if (!force) {
editor = getEditor(); editor = getEditor();
editor->activate(); if (transferFocus && editor)
//pMainWindow->updateClassBrowserForEditor(editor); editor->activate();
else
pMainWindow->updateClassBrowserForEditor(editor);
} }
if (pageCount()==0) { if (pageCount()==0) {
pMainWindow->updateAppTitle(); pMainWindow->updateAppTitle();

View File

@ -3358,6 +3358,11 @@ void MainWindow::onOJProblemCaseFinished(const QString &id, int current, int tot
ProblemCaseTestState::Passed: ProblemCaseTestState::Passed:
ProblemCaseTestState::Failed; ProblemCaseTestState::Failed;
mOJProblemModel.update(row); mOJProblemModel.update(row);
QModelIndex idx = ui->lstProblemCases->currentIndex();
if (idx.isValid()) {
if (row == idx.row())
ui->txtProblemCaseOutput->setText(problemCase->output);
}
} }
ui->pbProblemCases->setMaximum(total); ui->pbProblemCases->setMaximum(total);
ui->pbProblemCases->setValue(current); ui->pbProblemCases->setValue(current);