MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / singleSubtaskDependenceFinished

Method singleSubtaskDependenceFinished

src/judgingdialog.cpp:253–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

251}
252
253void 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
286void JudgingDialog::taskJudgingStarted(const QString &taskName) {
287 bool isOnMaxValue =

Callers

nothing calls this directly

Calls 1

statusRankingTextFunction · 0.85

Tested by

no test coverage detected