Skip to content

Commit

Permalink
Force the styles that has been used before 6.8 on windows until bug i…
Browse files Browse the repository at this point in the history
…s fixed
  • Loading branch information
luisangelsm committed Dec 28, 2024
1 parent 70c0a1a commit b51ffde
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions YACReader/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions YACReaderLibrary/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,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;
Expand Down

0 comments on commit b51ffde

Please sign in to comment.