Skip to content

Commit

Permalink
Update Qt to 6.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpurcell committed Jul 5, 2024
1 parent 7e89201 commit 2882ec0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ jobs:
qtVersion: '5.15.2'
buildArch: 'X64'
- runner: 'macos-14'
qtVersion: '6.5.3'
qtVersion: '6.7.2'
qtModules: 'qtimageformats'
buildArch: 'Universal'
- runner: 'macos-14'
qtVersion: '5.15.2'
osSuffix: '_legacy'
buildArch: 'X64'
- runner: 'windows-2022'
qtVersion: '6.5.3'
qtVersion: '6.7.2'
qtArch: 'win64_msvc2019_64'
osSuffix: '_64'
qtModules: 'qtimageformats'
buildArch: 'X64'
- runner: 'windows-2022'
qtVersion: '6.5.3'
qtVersion: '6.7.2'
qtArch: 'win64_msvc2019_arm64'
osSuffix: '_arm64'
qtModules: 'qtimageformats'
Expand Down
16 changes: 14 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ int main(int argc, char *argv[])

SettingsManager::migrateOldSettings();

if (QSettings().value("options/nonnativetheme").toBool())
QApplication::setStyle("fusion");
#ifdef Q_OS_WIN
QString styleName = QSettings().value("options/nonnativetheme").toBool() ? "fusion" : QString();
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
if (styleName.isEmpty())
styleName = "windowsvista"; // Avoid windows11 style until it's less buggy
#endif
// The docs recommend calling QApplication's static setStyle before its constructor, one reason
// being that this allows styles to be set via command line arguments. Unfortunately it seems
// that after running windeployqt, some styles such as windowsvista and windows11 aren't yet
// loaded/available until the constructor runs. So we'll use this environment variable instead,
// which Qt uses as a fallback override mechanism if a style wasn't specified via command line.
if (!styleName.isEmpty())
qputenv("QT_STYLE_OVERRIDE", styleName.toLocal8Bit());
#endif

QVApplication app(argc, argv);

Expand Down

0 comments on commit 2882ec0

Please sign in to comment.