qt: 6.7.3 Implementation

Co-authored-by: Kleidis <167202775+kleidis@users.noreply.github.com>
This commit is contained in:
Briar 2025-03-31 18:33:05 +02:00
parent 345a2af636
commit 6c3381a608
11 changed files with 404 additions and 337 deletions

View file

@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2018 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
# SPDX-License-Identifier: GPL-3.0-or-later
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
@ -370,11 +370,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")
@ -384,15 +380,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
@ -450,9 +446,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)

View file

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <algorithm>
#include <array>
@ -736,19 +736,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());
}
@ -1137,4 +1137,4 @@ bool GRenderWindow::eventFilter(QObject* object, QEvent* event) {
emit MouseActivity();
}
return false;
}
}

View file

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2020 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <QInputDialog>
#include <QKeyEvent>
@ -505,7 +505,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 +523,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 +539,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 +549,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(),
@ -614,4 +614,4 @@ void TouchScreenPreview::PositionDot(QLabel* const dot, const int device_x,
contentsMargins().top() - static_cast<float>(dot->height()) / 2 + 0.5f);
dot->move(x_coord, y_coord);
}
}

View file

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2016 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include "yuzu/configuration/configure_ui.h"
@ -256,7 +256,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);
}

View file

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2015 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <regex>
#include <QApplication>
@ -235,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 {

View file

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2014 Citra Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
// SPDX-FileCopyrightText: Copyright yuzu/Citra Emulator Project / Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
#include <cinttypes>
#include <clocale>
@ -5234,9 +5234,6 @@ static void SetHighDPIAttributes() {
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
}
int main(int argc, char* argv[]) {