- fix: when running problem cases, the output textbox might be wrongly cleared.
This commit is contained in:
parent
79aecde9a5
commit
0099aa436a
|
@ -3494,7 +3494,7 @@ Are you really want to continue?</oldsource>
|
|||
<message>
|
||||
<location filename="mainwindow.ui" line="1546"/>
|
||||
<source>Tool Panels</source>
|
||||
<translation>工具视图</translation>
|
||||
<translation>工具面板</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="mainwindow.ui" line="1771"/>
|
||||
|
@ -4209,7 +4209,7 @@ Are you really want to continue?</oldsource>
|
|||
<message>
|
||||
<location filename="mainwindow.ui" line="2525"/>
|
||||
<source>Show Tool Panels</source>
|
||||
<translation>显示全部工具视图</translation>
|
||||
<translation>显示全部工具面板</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Tool Window Bars</source>
|
||||
|
|
|
@ -117,6 +117,7 @@ void OJProblemCasesRunner::runCase(int index,POJProblemCase problemCase)
|
|||
}
|
||||
if (process.state() == QProcess::ProcessState::NotRunning)
|
||||
buffer += process.readAll();
|
||||
emit newOutputGetted(problemCase->getId(),QString::fromLocal8Bit(buffer));
|
||||
output.append(buffer);
|
||||
if (errorOccurred) {
|
||||
//qDebug()<<"process error:"<<process.error();
|
||||
|
|
|
@ -4070,11 +4070,10 @@ void MainWindow::onOJProblemCaseStarted(const QString& id,int current, int total
|
|||
problemCase->testState = ProblemCaseTestState::Testing;
|
||||
mOJProblemModel.update(row);
|
||||
QModelIndex idx = ui->lstProblemCases->currentIndex();
|
||||
if (idx.isValid()) {
|
||||
if (row == idx.row()) {
|
||||
ui->txtProblemCaseOutput->clear();
|
||||
}
|
||||
if (!idx.isValid() || row != idx.row()) {
|
||||
ui->lstProblemCases->setCurrentIndex(mOJProblemModel.index(row,0));
|
||||
}
|
||||
ui->txtProblemCaseOutput->clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue