HomePhabricator

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

Description

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

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

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, deadalnix, Fabien

Subscribers: deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D7533

Details

Provenance
majcostaAuthored on Sep 16 2020, 17:27
majcostaPushed on Sep 23 2020, 12:50
Reviewer
Restricted Project
Differential Revision
D7533: [fix] only use horizontalAdvance for Qt versions which support it
Parents
rABCce5bf0a88038: depends: Add --sysroot option to mac os native compile flags
Branches
Unknown
Tags
Unknown