diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp index b9913f3ec93e97444903cae1f8c6a8b721553364..e3575fdeed7a2c6fb954bce99ca49d60991eae23 100644 --- a/src/plugins/projectexplorer/outputwindow.cpp +++ b/src/plugins/projectexplorer/outputwindow.cpp @@ -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 }