Skip to content

Commit 4e1154d

Browse files
committed
qt: Use "fusion" style on macOS Big Sur with old Qt
The "macintosh" style is broken on macOS Big Sur at least for Qt 5.9.8.
1 parent d7e2401 commit 4e1154d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/qt/bitcoin.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <QThread>
5252
#include <QTimer>
5353
#include <QTranslator>
54+
#include <QtGlobal>
5455

5556
#if defined(QT_STATICPLUGIN)
5657
#include <QtPlugin>
@@ -466,6 +467,13 @@ int GuiMain(int argc, char* argv[])
466467
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
467468
#endif
468469

470+
#if (QT_VERSION <= QT_VERSION_CHECK(5, 9, 8)) && defined(Q_OS_MACOS)
471+
const auto os_name = QSysInfo::prettyProductName();
472+
if (os_name.startsWith("macOS 11") || os_name.startsWith("macOS 10.16")) {
473+
QApplication::setStyle("fusion");
474+
}
475+
#endif
476+
469477
BitcoinApplication app;
470478

471479
/// 2. Parse command-line options. We do this after qt in order to show an error if there are problems parsing these

0 commit comments

Comments
 (0)