Skip to content

Commit fa2f4bc

Browse files
author
MarcoFalke
committed
qt5: Use the fixed font the system recommends
1 parent 7a50401 commit fa2f4bc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/qt/guiutil.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
#include <QUrlQuery>
6363
#endif
6464

65+
#if QT_VERSION >= 0x50200
66+
#include <QFontDatabase>
67+
#endif
68+
6569
#if BOOST_FILESYSTEM_VERSION >= 3
6670
static boost::filesystem::detail::utf8_codecvt_facet utf8;
6771
#endif
@@ -90,13 +94,17 @@ QString dateTimeStr(qint64 nTime)
9094

9195
QFont fixedPitchFont()
9296
{
97+
#if QT_VERSION >= 0x50200
98+
return QFontDatabase::systemFont(QFontDatabase::FixedFont);
99+
#else
93100
QFont font("Monospace");
94101
#if QT_VERSION >= 0x040800
95102
font.setStyleHint(QFont::Monospace);
96103
#else
97104
font.setStyleHint(QFont::TypeWriter);
98105
#endif
99106
return font;
107+
#endif
100108
}
101109

102110
void setupAddressWidget(QValidatedLineEdit *widget, QWidget *parent)

0 commit comments

Comments
 (0)