#4983 Fix drag zoom on Summary and Grid cross plots

This commit is contained in:
Gaute Lindkvist
2019-11-05 08:27:35 +01:00
parent 7d817d0277
commit c7b5957571
7 changed files with 67 additions and 9 deletions

View File

@@ -101,14 +101,12 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimPlotInterface* plotDefinition, QWidget*
m_zoomerLeft->setTrackerMode( QwtPicker::AlwaysOff );
m_zoomerLeft->setTrackerPen( QColor( Qt::black ) );
m_zoomerLeft->initMousePattern( 1 );
m_zoomerLeft->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier );
// Attach a zoomer for the right axis
m_zoomerRight = new RiuQwtPlotZoomer( canvas() );
m_zoomerRight->setAxis( xTop, yRight );
m_zoomerRight->setTrackerMode( QwtPicker::AlwaysOff );
m_zoomerRight->initMousePattern( 1 );
m_zoomerRight->setMousePattern( QwtEventPattern::MouseSelect1, Qt::LeftButton, Qt::ShiftModifier );
// MidButton for the panning
QwtPlotPanner* panner = new QwtPlotPanner( canvas() );
@@ -296,6 +294,23 @@ void RiuSummaryQwtPlot::updateLayout()
updateLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuSummaryQwtPlot::isZoomerActive() const
{
return m_zoomerLeft->isActiveAndValid() || m_zoomerRight->isActiveAndValid();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuSummaryQwtPlot::endZoomOperations()
{
m_zoomerLeft->endZoomOperation();
m_zoomerRight->endZoomOperation();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------