Build: Switch to Qt 6.5.0 on Windows

This commit is contained in:
Stenzek
2023-08-06 14:50:16 +10:00
parent 68eb32f963
commit 827446b27f
4 changed files with 16 additions and 12 deletions

View File

@ -70,7 +70,6 @@ const char* DEFAULT_THEME_NAME = "darkfusion";
MainWindow* g_main_window = nullptr;
static QString s_unthemed_style_name;
static QPalette s_unthemed_palette;
static bool s_unthemed_style_name_set;
#if defined(_WIN32) || defined(__APPLE__)
@ -131,7 +130,6 @@ void MainWindow::updateApplicationTheme()
{
s_unthemed_style_name_set = true;
s_unthemed_style_name = QApplication::style()->objectName();
s_unthemed_palette = QApplication::style()->standardPalette();
}
setStyleFromSettings();
@ -2117,10 +2115,14 @@ void MainWindow::setStyleFromSettings()
{
const std::string theme(Host::GetBaseStringSettingValue("UI", "Theme", DEFAULT_THEME_NAME));
// setPalette() shouldn't be necessary, as the documentation claims that setStyle() resets the palette, but it
// is here, to work around a bug in 6.4.x and 6.5.x where the palette doesn't restore after changing themes.
qApp->setPalette(QPalette());
if (theme == "qdarkstyle")
{
qApp->setStyle(s_unthemed_style_name);
qApp->setPalette(s_unthemed_palette);
qApp->setStyleSheet(QString());
QFile f(QStringLiteral(":qdarkstyle/style.qss"));
if (f.open(QFile::ReadOnly | QFile::Text))
@ -2128,9 +2130,8 @@ void MainWindow::setStyleFromSettings()
}
else if (theme == "fusion")
{
qApp->setPalette(s_unthemed_palette);
qApp->setStyleSheet(QString());
qApp->setStyle(QStyleFactory::create("Fusion"));
qApp->setStyleSheet(QString());
}
else if (theme == "darkfusion")
{
@ -2207,9 +2208,8 @@ void MainWindow::setStyleFromSettings()
}
else
{
qApp->setPalette(s_unthemed_palette);
qApp->setStyleSheet(QString());
qApp->setStyle(s_unthemed_style_name);
qApp->setStyleSheet(QString());
}
}