From 1c6ff72b239c24972bfcaa1b98c65c0162a59477 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 7 Dec 2019 08:58:12 +0200 Subject: [PATCH] Removed hard coded font value. Kept only its bold status. --HG-- branch : develop --- src/app/valentina/dialogs/dialoghistory.cpp | 4 +++- src/app/valentina/dialogs/dialogincrements.cpp | 4 +++- .../dialogs/support/dialogeditwrongformula.cpp | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index 6591a8672..78227df78 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -182,7 +182,9 @@ void DialogHistory::FillTable() } QTableWidgetItem *item = new QTableWidgetItem(historyRecord); - item->setFont(QFont("Times", 12, QFont::Bold)); + QFont font = item->font(); + font.setBold(true); + item->setFont(font); item->setFlags(item->flags() ^ Qt::ItemIsEditable); ui->tableWidget->setItem(currentRow, 1, item); ++count; diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 4dea73686..7aed14008 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -210,7 +210,9 @@ void DialogIncrements::FillTable(const QMap &varTable, QTableWidget QTableWidgetItem *item = new QTableWidgetItem(i.key()); item->setTextAlignment(Qt::AlignLeft); - item->setFont(QFont(QStringLiteral("Times"), 12, QFont::Bold)); + QFont font = item->font(); + font.setBold(true); + item->setFont(font); table->setItem(currentRow, 0, item); item = new QTableWidgetItem(qApp->LocaleToString(length)); diff --git a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp index da16a85b6..3867db315 100644 --- a/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp +++ b/src/libs/vtools/dialogs/support/dialogeditwrongformula.cpp @@ -536,7 +536,9 @@ void DialogEditWrongFormula::ShowVariable(const QMap &var) {// If we create this variable don't show ui->tableWidget->setRowCount(ui->tableWidget->rowCount() + 1); QTableWidgetItem *item = new QTableWidgetItem(iMap.key()); - item->setFont(QFont("Times", 12, QFont::Bold)); + QFont font = item->font(); + font.setBold(true); + item->setFont(font); ui->tableWidget->setItem(ui->tableWidget->rowCount()-1, ColumnName, item); } } @@ -570,11 +572,15 @@ void DialogEditWrongFormula::ShowMeasurements(const QMaptableWidget->setRowCount(ui->tableWidget->rowCount() + 1); QTableWidgetItem *itemName = new QTableWidgetItem(iMap.key()); - itemName->setFont(QFont("Times", 12, QFont::Bold)); + QFont fontName = itemName->font(); + fontName.setBold(true); + itemName->setFont(fontName); itemName->setToolTip(itemName->text()); QTableWidgetItem *itemFullName = new QTableWidgetItem(); - itemFullName->setFont(QFont("Times", 12, QFont::Bold)); + QFont fontFullName = itemName->font(); + fontFullName.setBold(true); + itemFullName->setFont(fontFullName); if (iMap.value()->IsCustom()) { itemFullName->setText(iMap.value()->GetGuiText()); @@ -612,7 +618,9 @@ void DialogEditWrongFormula::ShowFunctions() { ui->tableWidget->setRowCount(ui->tableWidget->rowCount() + 1); QTableWidgetItem *item = new QTableWidgetItem(i.value().translate(qApp->Settings()->GetLocale())); - item->setFont(QFont("Times", 12, QFont::Bold)); + QFont font = item->font(); + font.setBold(true); + item->setFont(font); ui->tableWidget->setItem(ui->tableWidget->rowCount()-1, ColumnName, item); item->setToolTip(i.value().getMdisambiguation()); ++i;