mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-18 16:42:54 +01:00
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.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user