Merge bitcoin-core/gui#177: Use "fusion" style on macOS Big Sur with old Qt

4e1154dfd1 qt: Use "fusion" style on macOS Big Sur with old Qt (Hennadii Stepanov)

Pull request description:

  The "macintosh" style is broken on macOS Big Sur:

  - https://github.com/bitcoin/bitcoin/issues/20555#issuecomment-756264648
  - #136

ACKs for top commit:
  MarcoFalke:
    review ACK 4e1154dfd1 can't test
  jarolrod:
    ACK 4e1154dfd1
  jonasschnelli:
    Tested ACK 4e1154dfd1

Tree-SHA512: c2e0f7be220c8b34b182c73e362f41d0e8c8c002e766fcb5491c62f3cfb9f70eabbd32b29baefa152135efc5f83b15534c1c2459e500a586b0f64c5aa8acf614
pull/826/head
Jonas Schnelli 4 years ago
commit 02b01651c5
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D

@ -51,6 +51,7 @@
#include <QThread> #include <QThread>
#include <QTimer> #include <QTimer>
#include <QTranslator> #include <QTranslator>
#include <QtGlobal>
#if defined(QT_STATICPLUGIN) #if defined(QT_STATICPLUGIN)
#include <QtPlugin> #include <QtPlugin>
@ -466,6 +467,13 @@ int GuiMain(int argc, char* argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif #endif
#if (QT_VERSION <= QT_VERSION_CHECK(5, 9, 8)) && defined(Q_OS_MACOS)
const auto os_name = QSysInfo::prettyProductName();
if (os_name.startsWith("macOS 11") || os_name.startsWith("macOS 10.16")) {
QApplication::setStyle("fusion");
}
#endif
BitcoinApplication app; BitcoinApplication app;
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these /// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these

Loading…
Cancel
Save