From f807bbf4c51e67775d8d312999b6decfe2650e3c Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Fri, 16 Nov 2018 08:52:10 +0200 Subject: [PATCH] OutputFormatter: Remove unused font objects They're both default-initialized. Amends 8dfa9a5dab144797e446b09979be98642403259a. Change-Id: Ic990bad2a55a18a205d1cd1f696b7c16cf07377e Reviewed-by: Tobias Hunger --- src/libs/utils/outputformatter.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/libs/utils/outputformatter.cpp b/src/libs/utils/outputformatter.cpp index ab47485e6e3..cb066b6816b 100644 --- a/src/libs/utils/outputformatter.cpp +++ b/src/libs/utils/outputformatter.cpp @@ -39,7 +39,6 @@ class OutputFormatterPrivate public: QPlainTextEdit *plainTextEdit = nullptr; QTextCharFormat formats[NumberOfFormats]; - QFont font; QTextCursor cursor; AnsiEscapeCodeHandler escapeCodeHandler; bool overwriteOutput = false; @@ -126,34 +125,27 @@ void OutputFormatter::initFormats() if (!plainTextEdit()) return; - QFont boldFont; - boldFont.setBold(true); - Theme *theme = creatorTheme(); // NormalMessageFormat - d->formats[NormalMessageFormat].setFont(boldFont, QTextCharFormat::FontPropertiesSpecifiedOnly); + d->formats[NormalMessageFormat].setFontWeight(QFont::Bold); d->formats[NormalMessageFormat].setForeground(theme->color(Theme::OutputPanes_NormalMessageTextColor)); // ErrorMessageFormat - d->formats[ErrorMessageFormat].setFont(boldFont, QTextCharFormat::FontPropertiesSpecifiedOnly); + d->formats[ErrorMessageFormat].setFontWeight(QFont::Bold); d->formats[ErrorMessageFormat].setForeground(theme->color(Theme::OutputPanes_ErrorMessageTextColor)); // LogMessageFormat - d->formats[LogMessageFormat].setFont(d->font, QTextCharFormat::FontPropertiesSpecifiedOnly); d->formats[LogMessageFormat].setForeground(theme->color(Theme::OutputPanes_WarningMessageTextColor)); // StdOutFormat - d->formats[StdOutFormat].setFont(d->font, QTextCharFormat::FontPropertiesSpecifiedOnly); d->formats[StdOutFormat].setForeground(theme->color(Theme::OutputPanes_StdOutTextColor)); d->formats[StdOutFormatSameLine] = d->formats[StdOutFormat]; // StdErrFormat - d->formats[StdErrFormat].setFont(d->font, QTextCharFormat::FontPropertiesSpecifiedOnly); d->formats[StdErrFormat].setForeground(theme->color(Theme::OutputPanes_StdErrTextColor)); d->formats[StdErrFormatSameLine] = d->formats[StdErrFormat]; - d->formats[DebugFormat].setFont(d->font, QTextCharFormat::FontPropertiesSpecifiedOnly); d->formats[DebugFormat].setForeground(theme->color(Theme::OutputPanes_DebugTextColor)); }