Avoid Qt 6.7 bug when using windows11 style

Still not fixed in 6.7.3 (https://bugreports.qt.io/browse/QTBUG-124150)
This commit is contained in:
Alejandro Martinez
2024-12-22 21:47:50 -03:00
parent 2979ed8790
commit e9e83936d4

View File

@@ -56,6 +56,12 @@
#include <gsl/gsl_errno.h>
#ifdef Q_OS_WIN
#if QT_VERSION > 0x060700
#include <QStyleFactory>
#endif
#endif
//
// bootstrap state
//
@@ -429,6 +435,15 @@ main(int argc, char *argv[])
// create the application -- only ever ONE regardless of restarts
application = new QApplication(argc, argv);
#ifdef Q_OS_WIN
#if QT_VERSION > 0x060700
if (application->style()->name() == "windows11") {
application->setStyle(QStyleFactory::create("Windows"));
qDebug()<<"Replacing windows11 by Windows style to avoid a Qt bug";
}
#endif
#endif
//XXXIdleEventFilter idleFilter;
//XXXapplication->installEventFilter(&idleFilter);