Change a QwtPlotZoomer zoom base without rescale if zooming
Hello,
Is there a way to change the zoom base without rescaling ? Better than this:
Code:
{
public:
void setZoomBase
( const QRectF &base
);
};
{
}
void PlotZoomer
::setZoomBase(const QRectF &base
) {
if ( !plot() )
return;
int currentIndex = zoomRectIndex();
QStack<QRectF>* stack = new QStack<QRectF>();
*stack = zoomStack();
stack->replace(0, base);
setZoomStack(*stack, 0);
zoom(currentIndex);
}
I code an oscilloscope-like which receive data continuously. And I want to add a QwtPlotMagnifier and QwtPlotZoomer. The x scale move to follow data, but if we zoom, the screen should stay "freezed" even if we would be up-to-date when unzooming.
Sorry for my English :rolleyes:
Edit: My solution works well in fact ^^
Re: Change a QwtPlotZoomer zoom base without rescale if zooming
Don't use new for your stack - your code produces memory leaks.
uwe