summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvampiric_x <vampiric_x@citron-emu.org>2025-01-12 04:26:22 +0100
committerMike Lothian <mike@fireburn.co.uk>2025-05-11 12:17:03 +0100
commit58eaee33b516760e15a992fe9f48e7ffbfd0e795 (patch)
tree4bb807b15f34d9d6f55f8920526c9f602444e296 /src
parent4768701377056cb10ba84cc993bfad88d637ff05 (diff)
ui(QT): QT 6.7.3 Implementation
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/CMakeLists.txt19
-rw-r--r--src/yuzu/bootmanager.cpp9
-rw-r--r--src/yuzu/configuration/configure_touch_from_button.cpp11
-rw-r--r--src/yuzu/configuration/configure_ui.cpp2
-rw-r--r--src/yuzu/game_list.cpp3
-rw-r--r--src/yuzu/main.cpp6
6 files changed, 23 insertions, 27 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt
index 0259a8c29..a8357f7e0 100644
--- a/src/yuzu/CMakeLists.txt
+++ b/src/yuzu/CMakeLists.txt
@@ -1,4 +1,5 @@
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
+# SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025
# SPDX-License-Identifier: GPL-2.0-or-later
set(CMAKE_AUTOMOC ON)
@@ -368,11 +369,7 @@ if (APPLE)
elseif(WIN32)
# compile as a win32 gui application instead of a console application
- if (QT_VERSION VERSION_GREATER_EQUAL 6)
- target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate)
- else()
- target_link_libraries(yuzu PRIVATE Qt5::WinMain)
- endif()
+ target_link_libraries(yuzu PRIVATE Qt6::EntryPointPrivate)
if(MSVC)
target_link_libraries(yuzu PRIVATE version.lib)
set_target_properties(yuzu PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
@@ -382,15 +379,15 @@ elseif(WIN32)
endif()
target_link_libraries(yuzu PRIVATE common core input_common frontend_common network video_core)
-target_link_libraries(yuzu PRIVATE Boost::headers glad Qt${QT_MAJOR_VERSION}::Widgets)
+target_link_libraries(yuzu PRIVATE Boost::headers glad Qt6::Widgets)
target_link_libraries(yuzu PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
target_link_libraries(yuzu PRIVATE Vulkan::Headers)
if (NOT WIN32)
- target_include_directories(yuzu PRIVATE ${Qt${QT_MAJOR_VERSION}Gui_PRIVATE_INCLUDE_DIRS})
+ target_include_directories(yuzu PRIVATE ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
endif()
if (UNIX AND NOT APPLE)
- target_link_libraries(yuzu PRIVATE Qt${QT_MAJOR_VERSION}::DBus)
+ target_link_libraries(yuzu PRIVATE Qt6::DBus)
endif()
target_compile_definitions(yuzu PRIVATE
@@ -448,9 +445,9 @@ if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6)
add_custom_command(TARGET yuzu POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${YUZU_EXE_DIR}/yuzu.exe" --dir "${YUZU_EXE_DIR}" --libdir "${YUZU_EXE_DIR}" --plugindir "${YUZU_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0)
endif()
-if (YUZU_USE_BUNDLED_QT AND QT_VERSION VERSION_LESS 6)
- include(CopyYuzuQt5Deps)
- copy_yuzu_Qt5_deps(yuzu)
+if (YUZU_USE_BUNDLED_QT)
+ include(CopyYuzuQt6Deps)
+ copy_yuzu_Qt6_deps(yuzu)
endif()
if (ENABLE_SDL2)
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index ed5750155..6b98c41e6 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
+// SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025
// SPDX-License-Identifier: GPL-2.0-or-later
#include <algorithm>
@@ -736,19 +737,19 @@ void GRenderWindow::wheelEvent(QWheelEvent* event) {
}
void GRenderWindow::TouchBeginEvent(const QTouchEvent* event) {
- QList<QTouchEvent::TouchPoint> touch_points = event->touchPoints();
+ QList<QTouchEvent::TouchPoint> touch_points = event->points();
for (const auto& touch_point : touch_points) {
- const auto [x, y] = ScaleTouch(touch_point.pos());
+ const auto [x, y] = ScaleTouch(touch_point.position());
const auto [touch_x, touch_y] = MapToTouchScreen(x, y);
input_subsystem->GetTouchScreen()->TouchPressed(touch_x, touch_y, touch_point.id());
}
}
void GRenderWindow::TouchUpdateEvent(const QTouchEvent* event) {
- QList<QTouchEvent::TouchPoint> touch_points = event->touchPoints();
+ QList<QTouchEvent::TouchPoint> touch_points = event->points();
input_subsystem->GetTouchScreen()->ClearActiveFlag();
for (const auto& touch_point : touch_points) {
- const auto [x, y] = ScaleTouch(touch_point.pos());
+ const auto [x, y] = ScaleTouch(touch_point.position());
const auto [touch_x, touch_y] = MapToTouchScreen(x, y);
input_subsystem->GetTouchScreen()->TouchMoved(touch_x, touch_y, touch_point.id());
}
diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp
index 18e2eba69..57e216254 100644
--- a/src/yuzu/configuration/configure_touch_from_button.cpp
+++ b/src/yuzu/configuration/configure_touch_from_button.cpp
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2020 Citra Emulator Project
+// SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QInputDialog>
@@ -505,7 +506,7 @@ void TouchScreenPreview::mouseMoveEvent(QMouseEvent* event) {
if (!coord_label) {
return;
}
- const auto pos = MapToDeviceCoords(event->x(), event->y());
+ const auto pos = MapToDeviceCoords(event->position().x(), event->position().y());
if (pos) {
coord_label->setText(QStringLiteral("X: %1, Y: %2").arg(pos->x()).arg(pos->y()));
} else {
@@ -523,7 +524,7 @@ void TouchScreenPreview::mousePressEvent(QMouseEvent* event) {
if (event->button() != Qt::MouseButton::LeftButton) {
return;
}
- const auto pos = MapToDeviceCoords(event->x(), event->y());
+ const auto pos = MapToDeviceCoords(event->position().x(), event->position().y());
if (pos) {
emit DotAdded(*pos);
}
@@ -539,7 +540,7 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) {
emit DotSelected(obj->property(PropId).toInt());
drag_state.dot = qobject_cast<QLabel*>(obj);
- drag_state.start_pos = mouse_event->globalPos();
+ drag_state.start_pos = mouse_event->globalPosition().toPoint();
return true;
}
case QEvent::Type::MouseMove: {
@@ -549,13 +550,13 @@ bool TouchScreenPreview::eventFilter(QObject* obj, QEvent* event) {
const auto mouse_event = static_cast<QMouseEvent*>(event);
if (!drag_state.active) {
drag_state.active =
- (mouse_event->globalPos() - drag_state.start_pos).manhattanLength() >=
+ (mouse_event->globalPosition().toPoint() - drag_state.start_pos).manhattanLength() >=
QApplication::startDragDistance();
if (!drag_state.active) {
break;
}
}
- auto current_pos = mapFromGlobal(mouse_event->globalPos());
+ auto current_pos = mapFromGlobal(mouse_event->globalPosition().toPoint());
current_pos.setX(std::clamp(current_pos.x(), contentsMargins().left(),
contentsMargins().left() + contentsRect().width() - 1));
current_pos.setY(std::clamp(current_pos.y(), contentsMargins().top(),
diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp
index 98687b454..5eb2612bc 100644
--- a/src/yuzu/configuration/configure_ui.cpp
+++ b/src/yuzu/configuration/configure_ui.cpp
@@ -275,7 +275,7 @@ void ConfigureUi::InitializeLanguageComboBox() {
locale.truncate(locale.lastIndexOf(QLatin1Char{'.'}));
locale.remove(0, locale.lastIndexOf(QLatin1Char{'/'}) + 1);
const QString lang = QLocale::languageToString(QLocale(locale).language());
- const QString country = QLocale::countryToString(QLocale(locale).country());
+ const QString country = QLocale::territoryToString(QLocale(locale).territory());
ui->language_combobox->addItem(QStringLiteral("%1 (%2)").arg(lang, country), locale);
}
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 0dd106ce4..627d37bf2 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
+// SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QApplication>
@@ -234,7 +235,7 @@ void GameList::OnTextChanged(const QString& new_text) {
file_path.mid(file_path.lastIndexOf(QLatin1Char{'/'}) + 1) + QLatin1Char{' '} +
file_title;
if (ContainsAllWords(file_name, edit_filter_text) ||
- (file_program_id.count() == 16 && file_program_id.contains(edit_filter_text))) {
+ (file_program_id.size() == 16 && file_program_id.contains(edit_filter_text))) {
tree_view->setRowHidden(j, folder_index, false);
++result_count;
} else {
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 306f1f3f0..2bc6d1b36 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1,4 +1,5 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
+// SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025
// SPDX-License-Identifier: GPL-2.0-or-later
#include <cinttypes>
@@ -5268,11 +5269,6 @@ static void SetHighDPIAttributes() {
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
-
-#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
- QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
- QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-#endif
}
int main(int argc, char* argv[]) {