From c29d3b64336cb816efcb34fdb4a00f80e43bb9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= Date: Sat, 24 Sep 2022 20:23:28 +0200 Subject: [PATCH 1/2] Replace deprecated QWheelEvent.delta by angleDelta --- sdrgui/gui/graphicsviewzoom.cpp | 2 +- sdrgui/gui/valuedial.cpp | 2 +- sdrgui/gui/valuedialz.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdrgui/gui/graphicsviewzoom.cpp b/sdrgui/gui/graphicsviewzoom.cpp index 29b317abf..a210cfb07 100644 --- a/sdrgui/gui/graphicsviewzoom.cpp +++ b/sdrgui/gui/graphicsviewzoom.cpp @@ -70,7 +70,7 @@ bool GraphicsViewZoom::eventFilter(QObject *object, QEvent *event) QWheelEvent* wheelEvent = static_cast(event); if (QApplication::keyboardModifiers() == m_modifiers) { - if (wheelEvent->orientation() == Qt::Vertical) + if (wheelEvent->angleDelta().y() != 0) { double angle = wheelEvent->angleDelta().y(); double factor = qPow(m_zoomFactorBase, angle); diff --git a/sdrgui/gui/valuedial.cpp b/sdrgui/gui/valuedial.cpp index e01d1ad39..04b3ee24d 100644 --- a/sdrgui/gui/valuedial.cpp +++ b/sdrgui/gui/valuedial.cpp @@ -386,7 +386,7 @@ void ValueDial::wheelEvent(QWheelEvent *event) if (m_animationState == 0) { - if (event->delta() < 0) + if (event->angleDelta().y() < 0) { if (event->modifiers() & Qt::ShiftModifier) { e *= 5; diff --git a/sdrgui/gui/valuedialz.cpp b/sdrgui/gui/valuedialz.cpp index 740fde6b2..f66189f09 100644 --- a/sdrgui/gui/valuedialz.cpp +++ b/sdrgui/gui/valuedialz.cpp @@ -439,7 +439,7 @@ void ValueDialZ::wheelEvent(QWheelEvent* event) { qint64 e = findExponent(m_hightlightedDigit); - if(event->delta() < 0) + if(event->angleDelta().y() < 0) { if (event->modifiers() & Qt::ShiftModifier) { e *= 5; From a9f1c072d9ddc320fd429ee643cb73a5db76c799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= Date: Sat, 24 Sep 2022 21:20:56 +0200 Subject: [PATCH 2/2] Replace deprecated QWheelEvent.pos by position --- sdrgui/gui/glspectrum.cpp | 2 +- sdrgui/gui/glspectrum.h | 2 +- sdrgui/gui/valuedial.cpp | 2 +- sdrgui/gui/valuedialz.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdrgui/gui/glspectrum.cpp b/sdrgui/gui/glspectrum.cpp index 2d0936194..885610884 100644 --- a/sdrgui/gui/glspectrum.cpp +++ b/sdrgui/gui/glspectrum.cpp @@ -3674,7 +3674,7 @@ void GLSpectrum::channelMarkerMove(QWheelEvent *event, int mul) continue; } - if (m_channelMarkerStates[i]->m_rect.contains(event->pos())) + if (m_channelMarkerStates[i]->m_rect.contains(event->position())) { int freq = m_channelMarkerStates[i]->m_channelMarker->getCenterFrequency(); diff --git a/sdrgui/gui/glspectrum.h b/sdrgui/gui/glspectrum.h index de68c9e45..3e8200f0b 100644 --- a/sdrgui/gui/glspectrum.h +++ b/sdrgui/gui/glspectrum.h @@ -213,7 +213,7 @@ private: QMatrix4x4 m_glMatrixDsbFreqScale; QMatrix4x4 m_glMatrixHistogram; QMatrix4x4 m_glMatrixDsbHistogram; - QRect m_rect; + QRectF m_rect; ChannelMarkerState(ChannelMarker* channelMarker) : m_channelMarker(channelMarker) diff --git a/sdrgui/gui/valuedial.cpp b/sdrgui/gui/valuedial.cpp index 04b3ee24d..169398fea 100644 --- a/sdrgui/gui/valuedial.cpp +++ b/sdrgui/gui/valuedial.cpp @@ -367,7 +367,7 @@ void ValueDial::mouseMoveEvent(QMouseEvent *event) void ValueDial::wheelEvent(QWheelEvent *event) { int i; - i = (event->x() - 1) / m_digitWidth; + i = (event->position().x() - 1) / m_digitWidth; if (m_text[i] != m_groupSeparator) { m_hightlightedDigit = i; diff --git a/sdrgui/gui/valuedialz.cpp b/sdrgui/gui/valuedialz.cpp index f66189f09..7dc13da76 100644 --- a/sdrgui/gui/valuedialz.cpp +++ b/sdrgui/gui/valuedialz.cpp @@ -414,7 +414,7 @@ void ValueDialZ::wheelEvent(QWheelEvent* event) { int i; - i = (event->x() - 1) / m_digitWidth; + i = (event->position().x() - 1) / m_digitWidth; if ((m_text[i] != m_groupSeparator) && (m_text[i] != m_decSeparator)) { m_hightlightedDigit = i;