diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2019-08-23 20:13:11 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2019-08-23 21:27:50 +0300 |
commit | 1260ecd812e35185898fd555ad3e01d019072bcf (patch) | |
tree | 02a9912efdfadafbea77535b6730b141167a569f /src/qt/bitcoingui.cpp | |
parent | 442a9c64775454a7073aff9872721c58b1dd35c5 (diff) | |
download | bitcoin-1260ecd812e35185898fd555ad3e01d019072bcf.tar.xz |
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.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index bc9af9793e..9478247a41 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1407,7 +1407,7 @@ UnitDisplayStatusBarControl::UnitDisplayStatusBarControl(const PlatformStyle *pl const QFontMetrics fm(font()); for (const BitcoinUnits::Unit unit : units) { - max_width = qMax(max_width, fm.width(BitcoinUnits::longName(unit))); + max_width = qMax(max_width, GUIUtil::TextWidth(fm, BitcoinUnits::longName(unit))); } setMinimumSize(max_width, 0); setAlignment(Qt::AlignRight | Qt::AlignVCenter); |