PDA

View Full Version : QwtPlotItem inverting qwtPlot scale



jmsbc
11th August 2009, 21:13
Hi,

I have a weird problem where the y-axis will become inverted whenever I do a zoomBase from QwtPlotZoomer. The problem comes from the yMap's d_s1 and d_s2 values being inverted in my virtual void draw() function in my derived QwtPlotItem:



class CanvasPicture: public QwtPlotItem
{
public:
virtual void draw(QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
const QRect &rect) const
{
}


I put a break point in this draw function, and each time I zoomBase on the qwtPlot, I see the d_s1 and d_s2 values for yMap inverting each time (-10,10) to (10,-10) to (-10,10) etc.

My question is what would cause the yMap's scale intervals to be inverted each time draw() is being called? None of my setAxisScale() functions are being called whenever i do a zoomBase, so that's not the one that's inverting the scales.

Thank you

Uwe
25th August 2009, 14:09
My question is what would cause the yMap's scale intervals to be inverted each time draw() is being called?
Maybe autoscaling triggered from the replot ?

Uwe

PS: Are you aware of QwtScaleEngine::Inverted ?