diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index f642a3077..2304e0128 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -697,18 +697,24 @@ void RSGraphWidget::paintScale2() void RSGraphWidget::wheelEvent(QWheelEvent *e) { +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int delta = e->angleDelta().y(); +#else + int delta = e->delta(); +#endif + if(e->modifiers() & Qt::ShiftModifier) - if(e->delta() > 0) + if(delta > 0) _time_filter *= 1.1 ; else _time_filter /= 1.1 ; else if(e->modifiers() & Qt::ControlModifier) - if(e->delta() > 0) + if(delta > 0) _linewidthscale *= 1.2 ; else _linewidthscale /= 1.2 ; else - if(e->delta() > 0) + if(delta > 0) _time_scale *= 1.1 ; else _time_scale /= 1.1 ; diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index 750e73ff3..f62628ccd 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -342,7 +342,13 @@ void GraphWidget::resizeEvent(QResizeEvent *event) void GraphWidget::wheelEvent(QWheelEvent *event) { - scaleView(pow((double)2, -event->delta() / 240.0)); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int delta = event->angleDelta().y(); +#else + int delta = event->delta(); +#endif + + scaleView(pow((double)2, -delta / 240.0)); } void GraphWidget::scaleView(qreal scaleFactor) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp index 560c37577..dd0163371 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp @@ -283,7 +283,13 @@ void ZoomableLabel::wheelEvent(QWheelEvent *me) if(!mZoomEnabled) return; - float new_zoom_factor = (me->delta() > 0)?(mZoomFactor*1.05):(mZoomFactor/1.05); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int delta = me->angleDelta().y(); +#else + int delta = me->delta(); +#endif + + float new_zoom_factor = (delta > 0)?(mZoomFactor*1.05):(mZoomFactor/1.05); float new_center_x = mCenterX; float new_center_y = mCenterY; diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index 67013e1dc..333544a37 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -31,6 +31,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#endif #include #include @@ -429,16 +432,26 @@ void GlobalRouterStatisticsWidget::updateContent() void GlobalRouterStatisticsWidget::wheelEvent(QWheelEvent *e) { - if(e->x() < mMinWheelZoneX || e->x() > mMaxWheelZoneX || e->y() < mMinWheelZoneY || e->y() > mMaxWheelZoneY) +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int x = e->position().toPoint().x(); + int y = e->position().toPoint().y(); + int delta = e->angleDelta().y(); +#else + int x = e->x(); + int y = e->y(); + int delta = e->delta(); +#endif + + if(x < mMinWheelZoneX || x > mMaxWheelZoneX || y < mMinWheelZoneY || y > mMaxWheelZoneY) { QWidget::wheelEvent(e) ; return ; } - if(e->delta() < 0 && mCurrentN+PARTIAL_VIEW_SIZE/2+1 < mNumberOfKnownKeys) + if(delta < 0 && mCurrentN+PARTIAL_VIEW_SIZE/2+1 < mNumberOfKnownKeys) mCurrentN++ ; - if(e->delta() > 0 && mCurrentN > PARTIAL_VIEW_SIZE/2+1) + if(delta > 0 && mCurrentN > PARTIAL_VIEW_SIZE/2+1) mCurrentN-- ; updateContent();