| 172 | } |
| 173 | |
| 174 | void OutputPane::appendCustomText(const QString &textIn, AppendMode mode, const QTextCharFormat &format) |
| 175 | { |
| 176 | if (d->maxCharCount > 0 && d->outputEdit->document()->characterCount() >= d->maxCharCount) { |
| 177 | qDebug() << "Maximum limit exceeded : " << d->maxCharCount; |
| 178 | return; |
| 179 | } |
| 180 | |
| 181 | if (!d->cursor.atEnd()) |
| 182 | d->cursor.movePosition(QTextCursor::End); |
| 183 | |
| 184 | if (mode == OverWrite) { |
| 185 | d->cursor.select(QTextCursor::LineUnderCursor); |
| 186 | d->cursor.removeSelectedText(); |
| 187 | } |
| 188 | |
| 189 | auto text = mode == OverWrite ? textIn.trimmed() : normalizeNewlines(doNewlineEnforcement(textIn)); |
| 190 | d->cursor.insertText(text, format); |
| 191 | |
| 192 | if (d->maxCharCount > 0 && d->outputEdit->document()->characterCount() >= d->maxCharCount) { |
| 193 | QTextCharFormat tmp; |
| 194 | tmp.setFontWeight(QFont::Bold); |
| 195 | d->cursor.insertText(doNewlineEnforcement(tr("Additional output omitted") + QLatin1Char('\n')), tmp); |
| 196 | } |
| 197 | |
| 198 | if (!d->filterText.isEmpty()) |
| 199 | filterContent(false, false); |
| 200 | |
| 201 | scrollToBottom(); |
| 202 | } |
| 203 | |
| 204 | void OutputPane::appendText(const QString &text, OutputFormat format, AppendMode mode) |
| 205 | { |
nothing calls this directly
no test coverage detected