diff options
| author | Briar <205427297+icybriarr@users.noreply.github.com> | 2025-03-31 18:33:05 +0200 |
|---|---|---|
| committer | Briar <205427297+icybriarr@users.noreply.github.com> | 2025-04-04 03:23:31 +0200 |
| commit | 6c3381a608ece965c88d05e45d990bfaaf9d7d23 (patch) | |
| tree | 92dfcbc7cd5102c5ec9e3bd09a2745ad65b7c03c /src/yuzu/configuration/configure_touch_from_button.cpp | |
| parent | 345a2af636e7c9b98b6f7cb193470a37fa567aa8 (diff) | |
qt: 6.7.3 Implementation
Co-authored-by: Kleidis <167202775+kleidis@users.noreply.github.com>
Diffstat (limited to 'src/yuzu/configuration/configure_touch_from_button.cpp')
| -rw-r--r-- | src/yuzu/configuration/configure_touch_from_button.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/yuzu/configuration/configure_touch_from_button.cpp b/src/yuzu/configuration/configure_touch_from_button.cpp index 18e2eba696..a6c0cd6c77 100644 --- a/src/yuzu/configuration/configure_touch_from_button.cpp +++ b/src/yuzu/configuration/configure_touch_from_button.cpp @@ -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); -} +}
\ No newline at end of file |
