Page MenuHomePhabricator

[fix] only use horizontalAdvance for Qt versions which support it

Authored by majcosta on Sep 23 2020, 00:54.



Our cross-builds build against Qt 5.10.x or lower and were broken by D7524:

[00:44:34][Step 1/1] ../../src/qt/guiutil.cpp: In function ‘qreal GUIUtil::calculateIdealFontSize(int, const QString&, QFont, qreal, qreal)’:
[00:44:34][Step 1/1] ../../src/qt/guiutil.cpp:957:16: error: ‘class QFontMetrics’ has no member named ‘horizontalAdvance’
[00:44:34][Step 1/1]          if (fm.horizontalAdvance(text) < width) {
[00:44:34][Step 1/1]                 ^~~~~~~~~~~~~~~~~

This diff fixes that without an additional preprocessor conditional block

Test Plan
bitcoin-qt -regtest

Check if receive tab shows everything right

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix requested changes to this revision.Sep 23 2020, 01:21
deadalnix added a subscriber: deadalnix.

An explanation of what the problem is and how this fixes it would be nice.

This revision now requires changes to proceed.Sep 23 2020, 01:21

Yes, I broke our cross-builds with D7524 which apparently build against Qt 5.10.x or lower. This diff corrects that.

majcosta edited the summary of this revision. (Show Details)

wait a minute...

This revision is now accepted and ready to land.Sep 23 2020, 12:46