From d5b108d2efcf44ab5f4f844e81366c4149407ac4 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 25 Feb 2022 10:49:39 +0100 Subject: [PATCH] QtChart : Avoid zoom on right mouse button release --- ApplicationLibCode/UserInterface/RiuQtChartView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ApplicationLibCode/UserInterface/RiuQtChartView.cpp b/ApplicationLibCode/UserInterface/RiuQtChartView.cpp index edfd66821d..fe81705a6b 100644 --- a/ApplicationLibCode/UserInterface/RiuQtChartView.cpp +++ b/ApplicationLibCode/UserInterface/RiuQtChartView.cpp @@ -76,6 +76,12 @@ void RiuQtChartView::mouseReleaseEvent( QMouseEvent* event ) } else { + if ( event->button() == Qt::RightButton ) + { + // Skip QtCharts::QChartView::mouseReleaseEvent() to avoid zoom on right mouse button + return QGraphicsView::mouseReleaseEvent( event ); + } + QtCharts::QChartView::mouseReleaseEvent( event ); } }