From 9d8f4abac6fd39c36838e8bd2980b8a1ce9dfa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Wed, 25 Dec 2024 19:20:13 +0100 Subject: [PATCH] Force the styles that has been used before 6.8 on windows until bug is fixed --- YACReader/main.cpp | 8 ++++++++ YACReaderLibrary/main.cpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/YACReader/main.cpp b/YACReader/main.cpp index 39bbf3eb..c0c865b4 100644 --- a/YACReader/main.cpp +++ b/YACReader/main.cpp @@ -202,6 +202,14 @@ int main(int argc, char *argv[]) mwv->openComicFromPath(arglist.at(0)); } +// This forces the style that was being used before Qt6.7. Qt6.7 introduced a new style for Windows 11. The new style seems to have somo known bugs. +// There is a bug in the Windows 11 style that causes checked QToolButton to not have a background color (css doesn't work either). +// So it makes imposible for the user to see if the button is checked or not. +// QTBUG-132443 +#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + QApplication::setStyle("windowsvista"); +#endif + #ifdef Q_OS_MACOS app.setWindow(mwv); #endif diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index 0af94d5f..d762be76 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -285,6 +285,14 @@ int main(int argc, char **argv) app.installEventFilter(mw); +// This forces the style that was being used before Qt6.7. Qt6.7 introduced a new style for Windows 11. The new style seems to have somo known bugs. +// There is a bug in the Windows 11 style that causes checked QToolButton to not have a background color (css doesn't work either). +// So it makes imposible for the user to see if the button is checked or not. +// QTBUG-132443 +#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) + QApplication::setStyle("windowsvista"); +#endif + int ret = app.exec(); QLOG_INFO() << "YACReaderLibrary closed with exit code :" << ret;