QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)
Hi
I recently upgraded Qwt to 6.1.2 (from 6.1.0).
For one of my QwtPlot-derived class, I tweak the 'yLeft' axis scale engine to be QwtScaleEngine::Inverted. It used to work, but not anymore (i.e. the axis is not inverted).
I tracked down usage in Qwt source code. The flag is tested in , but unfortunately the method is not called, eventhough I call setAxisAutoScale(yLeft, true) in constructor. I'm not sure why the method is not called. QwtPlot::setAxisScale() seems to disable AutoScale, but is not called until I use magnifier or zoomer for the first time.
Any idea ?
Is QwtScaleEngine::Inverted flag broken ?
Is it possible to have an QwtScaleEngine::Inverted axis with zoomer/magnifier/panner tools ?
Re: QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)
Quote:
Is QwtScaleEngine::Inverted flag broken ?
Did a quick check with the simpleplot example: no problems there.
Quote:
Is it possible to have an QwtScaleEngine::Inverted axis with zoomer/magnifier/panner tools ?
Sure all of them preserve the direction of the scale.
When not using the autoscaler: setAxisScale( yLeft, 0, 10 ) is inverse to setAxisScale( yLeft, 10, 0 ) !
Uwe
Re: QwtScaleEngine::Inverted has no effect (Qwt 6.1.2)
I found what caused the problem
When data change, I want my view to fit contents. So I have a MyPlot::resetZoom() method, which used to be like this :
Code:
void MyPlot
::resetZoom(const QRectF & rect
) {
p_zoomer->zoom(rect);
p_zoomer->setZoomBase(rect);
p_zoomer->zoom(0);
}
and is called like this :
Code:
resetZoom(some_curve->boundingRect());
But I never quite understood the zoomer behaviour, and what to call to setup zoom level properly.
I just changed my code to not use a QwtPlotZoomer anymore (but still a magnifier), and modified resetZoom() method :
Code:
void MyPlot::resetZoom()
{
setAxisAutoScale(xAxis(), true);
setAxisAutoScale(yAxis(), true);
replot();
}
And it's ok now.
Some day I'll try to better understand all this stuff