Added colors to the "Application Output" panel.

This commit is contained in:
Erik Verbruggen
2010-04-19 15:55:02 +02:00
parent 825cea080a
commit 24a9a22b53
5 changed files with 83 additions and 20 deletions

View File

@@ -44,16 +44,18 @@ QmlOutputFormatter::QmlOutputFormatter(QObject *parent)
{
}
void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool /*onStdErr*/)
void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool onStdErr)
{
QTextCharFormat normalFormat, linkFormat;
normalFormat.setForeground(plainTextEdit()->palette().text().color());
linkFormat.setForeground(plainTextEdit()->palette().link().color());
if (onStdErr)
setFormat(StdErrFormat);
else
setFormat(StdOutFormat);
QTextCharFormat normalFormat = plainTextEdit()->currentCharFormat();
QTextCharFormat linkFormat = normalFormat;
linkFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
linkFormat.setAnchor(true);
plainTextEdit()->setCurrentCharFormat(normalFormat);
// Create links from QML errors (anything of the form "file:///...:[line]:[column]:")
int index = 0;
while (m_qmlError.indexIn(text, index) != -1) {
@@ -72,11 +74,6 @@ void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool /*onS
plainTextEdit()->insertPlainText(text.mid(index));
}
void QmlOutputFormatter::appendMessage(const QString &text, bool isError)
{
appendApplicationOutput(text, isError);
}
void QmlOutputFormatter::mousePressEvent(QMouseEvent * /*e*/)
{
m_mousePressed = true;