OutputFormatter: De-virtualize the clear() function

... and make it also clear the text edit.

Change-Id: Ifd073167b8afc27f3adafca1bdaf95316be7fdaa
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-03-18 09:53:07 +01:00
parent 438195ae83
commit f4473a6da8
4 changed files with 3 additions and 5 deletions

View File

@@ -147,6 +147,7 @@ void OutputFormatter::handleLink(const QString &href)
void OutputFormatter::clear()
{
d->prependCarriageReturn = false;
plainTextEdit()->clear();
}
void OutputFormatter::setBoldFontEnabled(bool enabled)

View File

@@ -56,7 +56,7 @@ public:
void appendMessage(const QString &text, OutputFormat format);
virtual void handleLink(const QString &href);
virtual void clear();
void clear();
void setBoldFontEnabled(bool enabled);
static QTextCharFormat linkFormat(const QTextCharFormat &inputFormat, const QString &href);

View File

@@ -436,10 +436,8 @@ void AndroidSdkManagerWidget::cancelPendingOperations()
void AndroidSdkManagerWidget::switchView(AndroidSdkManagerWidget::View view)
{
if (m_currentView == PackageListing) {
if (m_currentView == PackageListing)
m_formatter->clear();
m_ui->outputEdit->clear();
}
m_currentView = view;
if (m_currentView == PackageListing)
emit updatingSdkFinished();

View File

@@ -445,7 +445,6 @@ QMimeData *OutputWindow::createMimeDataFromSelection() const
void OutputWindow::clear()
{
QPlainTextEdit::clear();
d->formatter->clear();
}