setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot
Hello,
I have design the graph using Qwt libraries in which I have multiple curves.
And this graph is automatically replot itself as per the curves inputs, i.e. changes the X-Y scale of plot.
Now when I use QwtPlotZoomer, it has default zoomBase() as QRectF(0,0 1000x1000).
And during autoscale if I use my mouse key to go out of zoom stack it comes to the value of zoomBase. At this point my graph curve is hidden somewhere as its looks too small in this big scale.
So my intention to set zoomBase with the sale of autoScale of QwtPlot, so that when I came back of zoom then I should be at scale of autoScale, not at default scale.
Hope I'm able to explain my issue,
Thanks.
Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot
Quote:
Originally Posted by
npatil15
So my intention to set zoomBase with the sale of autoScale of QwtPlot, so that when I came back of zoom then I should be at scale of autoScale, not at default scale.
O.k. there is is QwtPlotZoomer::setZoomBase - but what is the question ?
Uwe
Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot
As we know, if we set setAxisAutoScale(QwtPlot::xBottom, true);, then X-axis plot will be autoscale as per the input curves. so now practically my zoomBase should be the current/updated scale interval of x and y axis, not the QRectF(0,0 1000x1000). So my intention is to do like this below, which is not the correct syntax.
Code:
{
private:
virtual void rescale() override;
}
{
m_plot = plot;
}
void ZoomPlot::rescale()
{
if(zoomRectIndex() == 0)
{
setZoomBase
(m_plot
->axisInterval
(QwtPlot::xBottom)) //Its not correct, so looking for correct syntax }
}
Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot
Code:
setZoomBase( scaleRect() );
Uwe
Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot
The return value of scaleRect() will surely worked as per my expectation,
But I have tried this, and its crashing the application when it hits this logic.