Skip to content

Commit f4c22de

Browse files
committed
Bump QT to 6.9.1 and fix windows
1 parent e2405ac commit f4c22de

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

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 & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,24 @@
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" ],
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
],
3037
"builtin-baseline": "a62ce77d56ee07513b4b67de1ec2daeaebfae51a",
3138
"overrides": [
32-
{ "name": "qtbase", "version": "6.6.3", "$comment": "For Windows only due to UI issues later. For non-Windows, edited out in CI" }
39+
{ "name": "qtbase", "version": "6.9.1", "$comment": "For Windows only due to UI issues later. For non-Windows, edited out in CI" }
3340
]
34-
}
41+
}

0 commit comments

Comments
 (0)