From 71abaf92cb81aeb832caac2372da2d60944f64b9 Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Wed, 10 Jun 2020 20:26:58 +0200 Subject: [PATCH] fix deprecated warning int QWheelEvent::delta() const Use angleDelta() instead manhattanLength() Returns the sum of the absolute values of x() and y(), traditionally known as the "Manhattan length" of the vector from the origin to the point. This class was introduced in Qt 5.5 --- sources/editor/elementview.cpp | 4 ++-- sources/titleblock/templateview.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/editor/elementview.cpp b/sources/editor/elementview.cpp index fa4bc7986..84386b903 100644 --- a/sources/editor/elementview.cpp +++ b/sources/editor/elementview.cpp @@ -415,11 +415,11 @@ void ElementView::wheelEvent(QWheelEvent *e) { //Zoom and scrolling if ( gestures() ) { if (e -> modifiers() & Qt::ControlModifier) - e -> delta() > 0 ? zoomInSlowly() : zoomOutSlowly(); + e -> angleDelta().manhattanLength() > 0 ? zoomInSlowly() : zoomOutSlowly(); else QGraphicsView::wheelEvent(e); } else { - e -> delta() > 0 ? zoomIn(): zoomOut(); + e -> angleDelta().manhattanLength() > 0 ? zoomIn(): zoomOut(); } } diff --git a/sources/titleblock/templateview.cpp b/sources/titleblock/templateview.cpp index a6e18a54d..90bf73ce5 100644 --- a/sources/titleblock/templateview.cpp +++ b/sources/titleblock/templateview.cpp @@ -511,7 +511,7 @@ qreal TitleBlockTemplateView::templateHeight() const { void TitleBlockTemplateView::wheelEvent(QWheelEvent *e) { // si la touche Ctrl est enfoncee, on zoome / dezoome if (e -> modifiers() & Qt::ControlModifier) { - if (e -> delta() > 0) { + if (e -> angleDelta().manhattanLength() > 0) { zoomIn(); } else { zoomOut();