forked from qt-creator/qt-creator
Remove duplicated code
Merge QtOutputFormatter::linkFormat and PythonOutputFormatter::linkFormat to OutputFormatter::linkFormat because these two functions were identical. Fixes: QTCREATORBUG-23562 Change-Id: I1337b2fd66fc7d7b6742eb5e9c1a2caf1dc6b5bd Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -112,6 +112,16 @@ void OutputFormatter::append(const QString &text, const QTextCharFormat &format)
|
||||
d->cursor.insertText(text.mid(startPos), format);
|
||||
}
|
||||
|
||||
QTextCharFormat OutputFormatter::linkFormat(const QTextCharFormat &inputFormat, const QString &href)
|
||||
{
|
||||
QTextCharFormat result = inputFormat;
|
||||
result.setForeground(creatorTheme()->color(Theme::TextColorLink));
|
||||
result.setUnderlineStyle(QTextCharFormat::SingleUnderline);
|
||||
result.setAnchor(true);
|
||||
result.setAnchorHref(href);
|
||||
return result;
|
||||
}
|
||||
|
||||
void OutputFormatter::clearLastLine()
|
||||
{
|
||||
if (!d->cursor.atEnd())
|
||||
|
||||
Reference in New Issue
Block a user