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();
if (!force) {
editor = getEditor();
editor->activate();
//pMainWindow->updateClassBrowserForEditor(editor);
if (transferFocus && editor)
editor->activate();
else
pMainWindow->updateClassBrowserForEditor(editor);
}
if (pageCount()==0) {
pMainWindow->updateAppTitle();

View File

@ -3358,6 +3358,11 @@ void MainWindow::onOJProblemCaseFinished(const QString &id, int current, int tot
ProblemCaseTestState::Passed:
ProblemCaseTestState::Failed;
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->setValue(current);