| 315 | } |
| 316 | |
| 317 | void OutputWidget::addHtml(const QString& html, const QString& messageType) { |
| 318 | TextLayoutLock lock(this); |
| 319 | auto cursor = nextInsertAt(); |
| 320 | if (messageType != "trace") { |
| 321 | _lastTraceLoc = ""; |
| 322 | } |
| 323 | if (messageType.isEmpty()) { |
| 324 | cursor.insertHtml(html); |
| 325 | } else { |
| 326 | addMessageType(messageType); |
| 327 | auto start = cursor.position(); |
| 328 | QTextBlockFormat f; |
| 329 | f.setProperty(Property::MessageType, messageType); |
| 330 | cursor.insertHtml(html); |
| 331 | auto end = cursor.position(); |
| 332 | cursor.setPosition(start); |
| 333 | while (cursor.position() < end) { |
| 334 | cursor.mergeBlockFormat(f); |
| 335 | cursor.block().setVisible(isMessageTypeVisible(messageType)); |
| 336 | cursor.movePosition(QTextCursor::NextBlock); |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | void OutputWidget::addTextToSection(const QString& section, const QString& text) |
| 342 | { |
no outgoing calls
no test coverage detected