Skip to content

Commit

Permalink
Initialize Qt high DPI scaling appropriately
Browse files Browse the repository at this point in the history
Refers to Bitcoin PR16524 by hebasto:

bitcoin/bitcoin#16254

Addresses GH #2776.
  • Loading branch information
chromatic committed Dec 25, 2021
1 parent a8026ba commit dae2b26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/qt/bitcoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,12 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(bitcoin);
Q_INIT_RESOURCE(bitcoin_locale);

BitcoinApplication app;
#if QT_VERSION > 0x050100
// Generate high-dpi pixmaps
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
#if QT_VERSION >= 0x050600
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#ifdef Q_OS_MAC
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
Expand All @@ -572,6 +571,8 @@ int main(int argc, char *argv[])
QSslConfiguration::setDefaultConfiguration(sslconf);
#endif

BitcoinApplication app;

// Register meta types used for QMetaObject::invokeMethod
qRegisterMetaType< bool* >();
// Need to pass name here as CAmount is a typedef (see http://qt-project.org/doc/qt-5/qmetatype.html#qRegisterMetaType)
Expand Down

0 comments on commit dae2b26

Please sign in to comment.