Re: About QwtPlotCurve Zoom out\Zoom in?
first of all , hello , everyone!
I program Curve application with Qwt, when I use QwtPlot::setAxisScale(xBottom, 0, 3600, 300), the result of ZoomIn is right,the scale show right , but the result of Zoom out is not correct.
I rewrite the function QwtText QwtScaleDraw::label(double v) const, I print out the value "v", is
v = 0
v = 3600
v = 300
v = 600
v = 900
v = 1200
v = 1500
v = 1800
v = 2100
v = 2400
v = 2700
v = 3000
v = 3600
and then , I perform ZoomIn , the result is
v = 900
v = 1800
v = 1200
v = 1500
and i click the mouseRightbutton , the result is not the same as I think,
v = 0
v = 3500
v = 500
v = 1000
v = 1500
v = 2000
v = 2500
v = 3000
what i need to do , to take the result as i think .
i want the result like this:
v = 0
v = 3600
v = 300
v = 600
v = 900
v = 1200
v = 1500
v = 1800
v = 2100
v = 2400
v = 2700
v = 3000
v = 3600
Re: About QwtPlotCurve Zoom out\Zoom in?
The zoomer doesn't know the about the step size ( 300 ), when zooming out.
One solution is to use QwtPlot::setAxisMaxMajor() instead of the step size - what affects the zoomer - or implement a slot connected to QwtPlotZoomer::zoomed(), where you fix the scale.
Uwe
Re: About QwtPlotCurve Zoom out\Zoom in?
first , thank Uwe very much !!!!
i don't understand what you said!
this is my code:
Code:
{
setAutoReplot(false);
new QTimeScaleDraw(m_TimeScaleFormat));
setAxisScale
(QwtPlot::xBottom,
0,
3600,
300);
setAutoReplot(true);
}
i don't know how to put the code"setAxisMaxMajor(QwtPlot::xBottom, 12);" where ?
and , how to implement the slot to QwtPlotZoomer::Zoomed()?
please give me some codes.