MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / addStatistics

Method addStatistics

MiniZincIDE/outputwidget.cpp:386–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386void OutputWidget::addStatistics(const QVariantMap& statistics)
387{
388 TextLayoutLock lock(this);
389 auto cursor = nextInsertAt();
390 _lastTraceLoc = "";
391 QTextBlockFormat f;
392 f.setProperty(Property::MessageType, "Statistics");
393 cursor.setBlockFormat(f);
394 addMessageType("Statistics");
395 for (auto it = statistics.begin(); it != statistics.end(); it++) {
396 if (!isMessageTypeVisible("Statistics")) {
397 cursor.block().setVisible(false);
398 }
399 cursor.insertText("%%%mzn-stat: ", _noticeCharFormat);
400 cursor.insertText(it.key(), _defaultCharFormat);
401 cursor.insertText("=", _defaultCharFormat);
402 cursor.insertText(it.value().toString(), _defaultCharFormat);
403 cursor.insertText("\n", _noticeCharFormat);
404 }
405 if (!isMessageTypeVisible("Statistics")) {
406 cursor.block().setVisible(false);
407 }
408 cursor.insertText("%%%mzn-stat-end\n", _noticeCharFormat);
409}
410
411void OutputWidget::addStatus(const QString& status, qint64 time)
412{

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
endMethod · 0.45
toStringMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected