Commit ddb424a1 authored by dt's avatar dt
Browse files

Fixes scrolling to the bottom of compile output

Patch mostly by mae.

Task-Nr:  QTCREATORBUG-1405
parent 44bf80a6
......@@ -92,6 +92,10 @@ QWidget *CompileOutputWindow::outputWidget(QWidget *)
void CompileOutputWindow::appendText(const QString &text, const QTextCharFormat &textCharFormat)
{
if (m_textEdit->document()->blockCount() > 10000)
return;
bool shouldScroll = (m_textEdit->verticalScrollBar()->value() ==
m_textEdit->verticalScrollBar()->maximum());
QString textWithNewline = text;
if (!textWithNewline.endsWith("\n"))
textWithNewline.append("\n");
......@@ -99,7 +103,17 @@ void CompileOutputWindow::appendText(const QString &text, const QTextCharFormat
cursor.movePosition(QTextCursor::End);
cursor.beginEditBlock();
cursor.insertText(textWithNewline, textCharFormat);
if (m_textEdit->document()->blockCount() > 10000) {
QTextCharFormat tmp;
tmp.setFontWeight(QFont::Bold);
cursor.insertText(tr("Additional output omitted\n"), tmp);
}
cursor.endEditBlock();
if (shouldScroll)
m_textEdit->setTextCursor(cursor);
}
void CompileOutputWindow::clearContents()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment