mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#871 Keep new zoom settings when toggling the curves/curve filter
This commit is contained in:
@@ -52,15 +52,18 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot(RimSummaryPlot* plotDefinition, QWidget* pa
|
||||
setDefaults();
|
||||
|
||||
// LeftButton for the zooming
|
||||
zoomer = new QwtPlotZoomer(canvas());
|
||||
zoomer->setRubberBandPen(QColor(Qt::black));
|
||||
zoomer->setTrackerMode(QwtPicker::AlwaysOff);
|
||||
zoomer->setTrackerPen(QColor(Qt::black));
|
||||
zoomer->initMousePattern(1);
|
||||
m_zoomer = new QwtPlotZoomer(canvas());
|
||||
m_zoomer->setRubberBandPen(QColor(Qt::black));
|
||||
m_zoomer->setTrackerMode(QwtPicker::AlwaysOff);
|
||||
m_zoomer->setTrackerPen(QColor(Qt::black));
|
||||
m_zoomer->initMousePattern(1);
|
||||
|
||||
// MidButton for the panning
|
||||
QwtPlotPanner* panner = new QwtPlotPanner(canvas());
|
||||
panner->setMouseButton(Qt::MidButton);
|
||||
|
||||
connect(m_zoomer, SIGNAL(zoomed( const QRectF & )), SLOT(onZoomedSlot()));
|
||||
connect(panner, SIGNAL(panned( int , int )), SLOT(onZoomedSlot()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -103,7 +106,7 @@ void RiuSummaryQwtPlot::zoomAll()
|
||||
setAxisAutoScale(yLeft, true);
|
||||
setAxisAutoScale(xBottom, true);
|
||||
|
||||
zoomer->setZoomBase(true);
|
||||
m_zoomer->setZoomBase(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -126,7 +129,7 @@ QRectF RiuSummaryQwtPlot::currentVisibleWindow() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::setZoomWindow(const QRectF& zoomWindow)
|
||||
{
|
||||
zoomer->zoom(zoomWindow);
|
||||
m_zoomer->zoom(zoomWindow);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -280,3 +283,11 @@ void RiuSummaryQwtPlot::selectClosestCurve(const QPoint& pos)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuSummaryQwtPlot::onZoomedSlot()
|
||||
{
|
||||
m_plotDefinition->setZoomWindow(currentVisibleWindow());
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class RimSummaryPlot;
|
||||
//==================================================================================================
|
||||
class RiuSummaryQwtPlot : public QwtPlot
|
||||
{
|
||||
Q_OBJECT;
|
||||
public:
|
||||
RiuSummaryQwtPlot(RimSummaryPlot* plotDefinition, QWidget* parent = NULL);
|
||||
virtual ~RiuSummaryQwtPlot();
|
||||
@@ -54,10 +55,13 @@ private:
|
||||
void setDefaults();
|
||||
void selectClosestCurve(const QPoint& pos);
|
||||
|
||||
private slots:
|
||||
void onZoomedSlot( );
|
||||
|
||||
private:
|
||||
QwtPlotGrid* m_grid;
|
||||
caf::PdmPointer<RimSummaryPlot> m_plotDefinition;
|
||||
QPointer<QwtPlotZoomer> zoomer;
|
||||
QPointer<QwtPlotZoomer> m_zoomer;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user