forked from qt-creator/qt-creator
Added colors to the "Application Output" panel.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user