Commit 22ace5fc authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Disable links to QML errors when compiling against Qt 4.6

This feature depends on the availability of QPlainTextEdit::anchorAt.
parent c46f9773
......@@ -460,6 +460,8 @@ void OutputWindow::appendOutputInline(const QString &out)
format.setForeground(palette().text().color());
setCurrentCharFormat(format);
// (This feature depends on the availability of QPlainTextEdit::anchorAt)
#if QT_VERSION >= 0x040700
// Convert to HTML, preserving newlines and whitespace
s = Qt::convertFromPlainText(s);
......@@ -472,6 +474,9 @@ void OutputWindow::appendOutputInline(const QString &out)
index += link.length();
}
appendHtml(s);
#else
appendPlainText(s);
#endif
}
enableUndoRedo();
......@@ -531,6 +536,7 @@ void OutputWindow::mouseReleaseEvent(QMouseEvent *e)
return;
}
#if QT_VERSION >= 0x040700
const QString href = anchorAt(e->pos());
if (!href.isEmpty()) {
QRegExp qmlErrorLink(QLatin1String("^file://(/[^:]+):(\\d+):(\\d+)"));
......@@ -542,12 +548,14 @@ void OutputWindow::mouseReleaseEvent(QMouseEvent *e)
TextEditor::BaseTextEditor::openEditorAt(fileName, line, column - 1);
}
}
#endif
}
void OutputWindow::mouseMoveEvent(QMouseEvent *e)
{
QPlainTextEdit::mouseMoveEvent(e);
#if QT_VERSION >= 0x040700
// Cursor was dragged to make a selection, deactivate links
if (m_mousePressed && textCursor().hasSelection())
m_linksActive = false;
......@@ -556,4 +564,5 @@ void OutputWindow::mouseMoveEvent(QMouseEvent *e)
viewport()->setCursor(Qt::IBeamCursor);
else
viewport()->setCursor(Qt::PointingHandCursor);
#endif
}
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