| 384 | } |
| 385 | |
| 386 | void 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 | |
| 411 | void OutputWidget::addStatus(const QString& status, qint64 time) |
| 412 | { |