| 251 | } |
| 252 | |
| 253 | void JudgingDialog::singleSubtaskDependenceFinished(int x, int y, int status) { |
| 254 | bool isOnMaxValue = |
| 255 | ui->logViewer->verticalScrollBar()->value() == ui->logViewer->verticalScrollBar()->maximum(); |
| 256 | QTextBlockFormat blockFormat; |
| 257 | blockFormat.setLeftMargin(30); |
| 258 | cursor->insertBlock(blockFormat); |
| 259 | QTextCharFormat charFormat; |
| 260 | QTextCharFormat ratioFormat; |
| 261 | charFormat.setFontPointSize(9); |
| 262 | ratioFormat.setFontPointSize(9); |
| 263 | QString text = statusRankingText(status); |
| 264 | |
| 265 | if (status >= maxDependValue) { |
| 266 | charFormat.setForeground(QBrush(Qt::lightGray)); |
| 267 | ratioFormat.setForeground(QBrush(Qt::green)); |
| 268 | } else if (status < 0) { |
| 269 | charFormat.setForeground(QBrush(Qt::red)); |
| 270 | ratioFormat.setForeground(QBrush(Qt::red)); |
| 271 | ratioFormat.setFontWeight(QFont::Bold); |
| 272 | } else { |
| 273 | charFormat.setForeground(QBrush(Qt::darkYellow)); |
| 274 | ratioFormat.setForeground(QBrush(Qt::darkYellow)); |
| 275 | ratioFormat.setFontWeight(QFont::Bold); |
| 276 | } |
| 277 | |
| 278 | cursor->insertText(tr("Subtask Dependence %1: #%2: ").arg(x + 1).arg(y), charFormat); |
| 279 | cursor->insertText(text, ratioFormat); |
| 280 | QScrollBar *bar = ui->logViewer->verticalScrollBar(); |
| 281 | |
| 282 | if (isOnMaxValue) |
| 283 | bar->setValue(bar->maximum()); |
| 284 | } |
| 285 | |
| 286 | void JudgingDialog::taskJudgingStarted(const QString &taskName) { |
| 287 | bool isOnMaxValue = |
nothing calls this directly
no test coverage detected