File rpcs3-PR15473.patch of Package rpcs3

From 856e8afedf4969eeb48755fc1e2fd124f66884e0 Mon Sep 17 00:00:00 2001
From: Megamouse <studienricky89@googlemail.com>
Date: Wed, 17 Apr 2024 23:40:45 +0200
Subject: [PATCH 1/2] Qt 6.7.0

Also fix new stylesheet issue: windows11 style is now default.
This currently breaks custom stylesheets.
Use windowsvista style as default
---
 .cirrus.yml                       |  4 ++--
 BUILDING.md                       |  8 ++++----
 azure-pipelines.yml               |  6 +++---
 rpcs3/rpcs3qt/gui_application.cpp | 11 ++++++++++-
 4 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/BUILDING.md b/BUILDING.md
index 70ecae48f7ac..9d70db14f333 100644
--- a/BUILDING.md
+++ b/BUILDING.md
@@ -9,11 +9,11 @@ Other instructions may be found [here](https://wiki.rpcs3.net/index.php?title=Bu
 
 * [CMake 3.28.0+](https://www.cmake.org/download/) (add to PATH)
 * [Python 3.6+](https://www.python.org/downloads/) (add to PATH)
-* [Qt 6.6.3](https://www.qt.io/download-qt-installer)
+* [Qt 6.7.0](https://www.qt.io/download-qt-installer)
 * [Visual Studio 2022](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community) (or at least Visual Studio 2019 16.11.xx+ as C++20 is not included in previous versions)
 * [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
 
-**Either add the** `QTDIR` **environment variable, e.g.** `<QtInstallFolder>\6.6.3\msvc2019_64\` **, or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019)**
+**Either add the** `QTDIR` **environment variable, e.g.** `<QtInstallFolder>\6.7.0\msvc2019_64\` **, or use the [Visual Studio Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools2019)**
 
 **NOTE: If you have issues with the Qt plugin, you may want to uninstall the Qt Plugin and install the [Legacy Qt Plugin](https://marketplace.visualstudio.com/items?itemName=TheQtCompany.LEGACYQtVisualStudioTools2019) instead.**
 
@@ -23,7 +23,7 @@ These are the essentials tools to build RPCS3 on Linux. Some of them can be inst
 
 * Clang 12+ or GCC 11+
 * [CMake 3.28.0+](https://www.cmake.org/download/)
-* [Qt 6.6.3](https://www.qt.io/download-qt-installer)
+* [Qt 6.7.0](https://www.qt.io/download-qt-installer)
 * [Vulkan SDK 1.3.268.0](https://vulkan.lunarg.com/sdk/home) (See "Install the SDK" [here](https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html)) for now future SDKs don't work. You need precisely 1.3.268.0.
 * [SDL2](https://github.com/libsdl-org/SDL/releases) (for the FAudio backend)
 
@@ -98,7 +98,7 @@ git submodule update --init
 #### Configuring the Qt plugin (if used)
 
 1) Go to `Extensions->Qt VS Tools->Qt Versions`.
-2) Add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.6.3\msvc2019_64`, version will fill in automatically.
+2) Add the path to your Qt installation with compiler e.g. `<QtInstallFolder>\6.7.0\msvc2019_64`, version will fill in automatically.
 3) Go to `Extensions->Qt VS Tools->Options->Legacy Project Format`. (Only available in the legacy Qt plugin)
 4) Set `Build: Run pre-build setup` to `true`. (Only available in the legacy Qt plugin)
 
diff --git a/rpcs3/rpcs3qt/gui_application.cpp b/rpcs3/rpcs3qt/gui_application.cpp
index a9c7ed8a4ff5..be65d594e7a9 100644
--- a/rpcs3/rpcs3qt/gui_application.cpp
+++ b/rpcs3/rpcs3qt/gui_application.cpp
@@ -886,8 +886,17 @@ void gui_application::OnChangeStyleSheetRequest()
 	// Determine default style
 	if (m_default_style.isEmpty())
 	{
+#ifdef _WIN32
+		// On windows, the custom stylesheets don't seem to work properly unless we use the windowsvista style as default
+		if (QStyleFactory::keys().contains("windowsvista"))
+		{
+			m_default_style = "windowsvista";
+			gui_log.notice("Using '%s' as default style", m_default_style);
+		}
+#endif
+
 		// Use the initial style as default style
-		if (const QStyle* style = QApplication::style())
+		if (const QStyle* style = m_default_style.isEmpty() ? QApplication::style() : nullptr)
 		{
 			m_default_style = style->name();
 			gui_log.notice("Determined '%s' as default style", m_default_style);

From 44ec8d7537fc6dcb88c2dd54845381dd79e161d2 Mon Sep 17 00:00:00 2001
From: Megamouse <studienricky89@googlemail.com>
Date: Thu, 18 Apr 2024 00:15:45 +0200
Subject: [PATCH 2/2] Qt: add QStringView to fmt_class_string

Just some future proofing
---
 rpcs3/main.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/rpcs3/main.cpp b/rpcs3/main.cpp
index cd685c4d4001..784a97eab866 100644
--- a/rpcs3/main.cpp
+++ b/rpcs3/main.cpp
@@ -428,6 +428,12 @@ void fmt_class_string<QString>::format(std::string& out, u64 arg)
  	out += get_object(arg).toStdString();
 }
 
+template <>
+void fmt_class_string<QStringView>::format(std::string& out, u64 arg)
+{
+ 	out += get_object(arg).toString().toStdString();
+}
+
 void log_q_debug(QtMsgType type, const QMessageLogContext& context, const QString& msg)
 {
 	Q_UNUSED(context)
openSUSE Build Service is sponsored by