PDA

View Full Version : Two zoomers - two replots on zoom action?



torrentss
19th August 2010, 14:25
Hello,

I'm using Qwt6 (SVN) I have two zoomers in my plot (one for yLeft/xBottom, the other for yRight/xTop). The thing is, each time I zoom in or zoom out, I see the plot render two times - once for each zoomer.
Since the data I'm plotting is quite large (curves with 10K points), the two redraws are clearly visible. I traced it to QwtPlotZoomer::rescale(), where it explicitly calls replot().
Is this a bug?

Thanks, Alexander.

Uwe
20th August 2010, 09:24
I traced it to QwtPlotZoomer::rescale(), where it explicitly calls replot().
Is this a bug?
No its more a consequence of a weak design. But there are enough virtual methods to implement something, that blocks an unwanted replot.

Uwe

torrentss
20th August 2010, 13:40
Thanks.
I reimplemented QwtPlotZoomer::rescale() in a child class, and made both zoomers instances of that class.
The new rescale() calls replot() only on every second call, which seems to do what I want.