Page MenuHomePhabricator

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

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

Details

Summary

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
ninja
bitcoin-qt -regtest

Check if receive tab shows everything right

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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.

https://build.bitcoinabc.org/viewLog.html?tab=buildLog&logTab=tree&filter=debug&expand=all&buildId=62975&_focus=2126

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