From 818651909f38f6616bda088ec9e30979046d477b Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Mon, 11 Oct 2021 10:43:39 -0400 Subject: Fix a few warnings - configure_input_player_widget.cpp: always better to use `const auto &` whenever possible - profiler.cpp: `ev->pos()` is deprecated, replace with `ev->position()`, which returns floats, thus the addition of `.toPoint()` (same as what's happening in `pos()`) - game_list.cpp: `QString::SplitBehavior` is deprecate, use `Qt::` namespace instead --- src/yuzu/debugger/profiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/yuzu/debugger/profiler.cpp') diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp index 7a6f84d96..778c25a9f 100644 --- a/src/yuzu/debugger/profiler.cpp +++ b/src/yuzu/debugger/profiler.cpp @@ -160,8 +160,8 @@ void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { } void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { - MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, - ev->angleDelta().y() / 120); + MicroProfileMousePosition(ev->position().toPoint().x() / x_scale, + ev->position().toPoint().y() / y_scale, ev->angleDelta().y() / 120); ev->accept(); } -- cgit v1.2.3 From 39b3c9022dc34b1f0e64278b88346c03003f5019 Mon Sep 17 00:00:00 2001 From: Romain Failliot Date: Mon, 11 Oct 2021 10:59:49 -0400 Subject: Create local variables for mouse and wheel positions --- src/yuzu/debugger/profiler.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/yuzu/debugger/profiler.cpp') diff --git a/src/yuzu/debugger/profiler.cpp b/src/yuzu/debugger/profiler.cpp index 778c25a9f..33110685a 100644 --- a/src/yuzu/debugger/profiler.cpp +++ b/src/yuzu/debugger/profiler.cpp @@ -143,25 +143,29 @@ void MicroProfileWidget::hideEvent(QHideEvent* ev) { } void MicroProfileWidget::mouseMoveEvent(QMouseEvent* ev) { - MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); + const auto mouse_position = ev->pos(); + MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); ev->accept(); } void MicroProfileWidget::mousePressEvent(QMouseEvent* ev) { - MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); + const auto mouse_position = ev->pos(); + MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); ev->accept(); } void MicroProfileWidget::mouseReleaseEvent(QMouseEvent* ev) { - MicroProfileMousePosition(ev->pos().x() / x_scale, ev->pos().y() / y_scale, 0); + const auto mouse_position = ev->pos(); + MicroProfileMousePosition(mouse_position.x() / x_scale, mouse_position.y() / y_scale, 0); MicroProfileMouseButton(ev->buttons() & Qt::LeftButton, ev->buttons() & Qt::RightButton); ev->accept(); } void MicroProfileWidget::wheelEvent(QWheelEvent* ev) { - MicroProfileMousePosition(ev->position().toPoint().x() / x_scale, - ev->position().toPoint().y() / y_scale, ev->angleDelta().y() / 120); + const auto wheel_position = ev->position().toPoint(); + MicroProfileMousePosition(wheel_position.x() / x_scale, wheel_position.y() / y_scale, + ev->angleDelta().y() / 120); ev->accept(); } -- cgit v1.2.3