#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

@@ -67,14 +67,12 @@ RiuGridCrossQwtPlot::RiuGridCrossQwtPlot( RimPlotInterface* plotDefinition, QWid
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() );
@@ -541,6 +539,23 @@ void RiuGridCrossQwtPlot::applyFontSizeToOverlayItem( caf::TitledOverlayFrame* o
overlayItem->setFont( cafFont.p() );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuGridCrossQwtPlot::isZoomerActive() const
{
return m_zoomerLeft->isActiveAndValid() || m_zoomerRight->isActiveAndValid();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuGridCrossQwtPlot::endZoomOperations()
{
m_zoomerLeft->endZoomOperation();
m_zoomerRight->endZoomOperation();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------