summaryrefslogtreecommitdiff
path: root/src/citron/configuration/configure_touch_from_button.cpp
diff options
context:
space:
mode:
authorvampiric_x <vampiric_x@citron-emu.org>2025-01-12 04:26:22 +0100
committervampiric_x <vampiric_x@citron-emu.org>2025-01-12 04:26:22 +0100
commit2d7f9d921b3508a5c5effba5604aaea5620441ef (patch)
tree60bf9c618aab4ad201f4ef12a03e709fc152f586 /src/citron/configuration/configure_touch_from_button.cpp
parentd3ed42af8f697fde240b26e02aab0c6cf3c137c5 (diff)
ui(QT): QT 6.7.3 Implementation
Diffstat (limited to 'src/citron/configuration/configure_touch_from_button.cpp')
-rw-r--r--src/citron/configuration/configure_touch_from_button.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/citron/configuration/configure_touch_from_button.cpp b/src/citron/configuration/configure_touch_from_button.cpp
index 605e96aa0..31816bdb2 100644
--- a/src/citron/configuration/configure_touch_from_button.cpp
+++ b/src/citron/configuration/configure_touch_from_button.cpp
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2020 Citra Emulator Project & 2025 Citron Homebrew Project
+// SPDX-FileCopyrightText: 2025 Citron Homebrew Emulator Project & vampiric_x 2025
// SPDX-License-Identifier: GPL-2.0-or-later
#include <QInputDialog>
@@ -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