Application output always scrolled, and moved the cursor.

Task-number: QTCREATORBUG-1790
Reviewed-by: dt
Reviewed-by: mae
This commit is contained in:
con
2010-07-06 15:06:33 +02:00
parent dec87b222b
commit 15047f8816
4 changed files with 19 additions and 44 deletions

View File

@@ -46,15 +46,7 @@ QmlOutputFormatter::QmlOutputFormatter(QObject *parent)
void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool onStdErr)
{
gotoEnd();
if (onStdErr)
setFormat(StdErrFormat);
else
setFormat(StdOutFormat);
QTextCharFormat normalFormat = plainTextEdit()->currentCharFormat();
QTextCharFormat linkFormat = normalFormat;
QTextCharFormat linkFormat;
linkFormat.setForeground(plainTextEdit()->palette().link().color());
linkFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
linkFormat.setAnchor(true);
@@ -64,17 +56,15 @@ void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool onStd
while (m_qmlError.indexIn(text, index) != -1) {
const int matchPos = m_qmlError.pos(1);
const QString leader = text.mid(index, matchPos - index);
plainTextEdit()->insertPlainText(leader);
append(leader, onStdErr ? StdErrFormat : StdOutFormat);
const QString matched = m_qmlError.cap(1);
linkFormat.setAnchorHref(matched);
plainTextEdit()->setCurrentCharFormat(linkFormat);
plainTextEdit()->insertPlainText(matched);
plainTextEdit()->setCurrentCharFormat(normalFormat);
append(matched, linkFormat);
index = matchPos + m_qmlError.matchedLength() - 1;
}
plainTextEdit()->insertPlainText(text.mid(index));
append(text.mid(index), onStdErr ? StdErrFormat : StdOutFormat);
}
void QmlOutputFormatter::mousePressEvent(QMouseEvent * /*e*/)