Skip to content

Commit f37c24e

Browse files
authored
Bump QT to 6.9.1, fix windows theme issue (spinbox...) (#540)
* Bump QT to 6.9.1 and fix windows * ci: vcpkg qtbase override applies to all platforms now, no sed needed
1 parent e2405ac commit f37c24e

File tree

5 files changed

+29
-17
lines changed

5 files changed

+29
-17
lines changed

.github/workflows/build.linux.workflow.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ jobs:
5252
run: |
5353
sudo sed -i 's/azure\.//' /etc/apt/sources.list
5454
55-
- name: Remove windows-only qt version override in vcpkg.json
56-
run: |
57-
sed -i '/For Windows only/d' ${{ github.workspace }}/gui/qt/vcpkg.json
58-
5955
- name: Install dependencies
6056
run: |
6157
set -e

.github/workflows/build.mac.workflow.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ jobs:
4545
with:
4646
submodules: 'recursive'
4747

48-
- name: Remove windows-only qt version override in vcpkg.json
49-
run: |
50-
sed -i '' '/For Windows only/d' ${{ github.workspace }}/gui/qt/vcpkg.json
51-
5248
- name: Install dependencies
5349
run: |
5450
set -e

gui/qt/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ endif()
7373
include(GNUInstallDirs)
7474

7575
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core)
76-
find_package(Qt6 REQUIRED COMPONENTS DBus Gui Network Widgets)
76+
find_package(Qt6 REQUIRED COMPONENTS Gui Network Widgets)
77+
if(NOT WIN32)
78+
find_package(Qt6 COMPONENTS DBus)
79+
endif()
7780

7881
set(CMAKE_AUTORCC ON)
7982
set(CMAKE_AUTOMOC ON)
@@ -284,10 +287,12 @@ endif()
284287
target_link_libraries(CEmu PRIVATE
285288
Qt::Core
286289
Qt::Gui
287-
Qt::DBus # needed at runtime by QtGui for some reason...?
288290
Qt::Network
289291
Qt::Widgets
290292
)
293+
if(TARGET Qt::DBus)
294+
target_link_libraries(CEmu PRIVATE Qt::DBus)
295+
endif()
291296

292297
include(CheckIPOSupported)
293298
check_ipo_supported(RESULT lto_supported OUTPUT error)

gui/qt/main.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <QtCore/QCommandLineParser>
88
#include <QtWidgets/QApplication>
99
#include <QtGui/QFontDatabase>
10+
#include <QtWidgets/QStyleFactory>
1011

1112
int main(int argc, char *argv[]) {
1213

@@ -16,6 +17,16 @@ int main(int argc, char *argv[]) {
1617
#endif
1718
QApplication app(argc, argv);
1819

20+
#if defined(Q_OS_WIN)
21+
const QString kDesiredStyle = QStringLiteral("WindowsVista");
22+
const auto availableStyles = QStyleFactory::keys();
23+
if (availableStyles.contains(kDesiredStyle, Qt::CaseInsensitive)) {
24+
QApplication::setStyle(QStyleFactory::create(kDesiredStyle));
25+
} else if (availableStyles.contains(QStringLiteral("Fusion"), Qt::CaseInsensitive)) {
26+
QApplication::setStyle(QStyleFactory::create(QStringLiteral("Fusion")));
27+
}
28+
#endif
29+
1930
QCoreApplication::setOrganizationName(QStringLiteral("cemu-dev"));
2031
QCoreApplication::setApplicationName(QStringLiteral("CEmu"));
2132
QCoreApplication::setApplicationVersion(QStringLiteral(CEMU_VERSION " (git: " CEMU_GIT_SHA ")"));

gui/qt/vcpkg.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818
{
1919
"name": "qtbase",
2020
"default-features": false,
21-
"features": [ "dbus", "gui", "network", "widgets", "png" ]
21+
"features": [ "gui", "network", "widgets", "png" ],
22+
"platform": "windows"
2223
},
2324
{
2425
"name": "qtbase",
2526
"default-features": false,
26-
"features": [ "fontconfig", "xcb" ],
27+
"features": [ "gui", "network", "widgets", "png", "dbus" ],
28+
"platform": "osx"
29+
},
30+
{
31+
"name": "qtbase",
32+
"default-features": false,
33+
"features": [ "gui", "network", "widgets", "png", "dbus", "fontconfig", "xcb" ],
2734
"platform": "linux"
2835
}
2936
],
30-
"builtin-baseline": "a62ce77d56ee07513b4b67de1ec2daeaebfae51a",
31-
"overrides": [
32-
{ "name": "qtbase", "version": "6.6.3", "$comment": "For Windows only due to UI issues later. For non-Windows, edited out in CI" }
33-
]
34-
}
37+
"builtin-baseline": "a62ce77d56ee07513b4b67de1ec2daeaebfae51a"
38+
}

0 commit comments

Comments
 (0)