qt: Add TextWidth() wrapper

In Qt 5.12 and before the QFontMetrics::width() is used and it is
deprecated since Qt 13.0.
In Qt 5.11 the QFontMetrics::horizontalAdvance() was introduced.
This commit is contained in:
Hennadii Stepanov
2019-08-23 20:13:11 +03:00
parent 442a9c6477
commit 1260ecd812
6 changed files with 28 additions and 10 deletions

View File

@@ -703,7 +703,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
int lightness = ui->fallbackFeeWarningLabel->palette().color(QPalette::WindowText).lightness();
QColor warning_colour(255 - (lightness / 5), 176 - (lightness / 3), 48 - (lightness / 14));
ui->fallbackFeeWarningLabel->setStyleSheet("QLabel { color: " + warning_colour.name() + "; }");
ui->fallbackFeeWarningLabel->setIndent(QFontMetrics(ui->fallbackFeeWarningLabel->font()).width("x"));
ui->fallbackFeeWarningLabel->setIndent(GUIUtil::TextWidth(QFontMetrics(ui->fallbackFeeWarningLabel->font()), "x"));
}
else
{