Many thanks for your answer, Uwe. It helped to solve my problem 
Just in case others have the same problem, here is the code for my reimplementation of the QwtPlotMagnifier::rescale function:
void Magnifier::rescale(double factor)
{
factor = qwtAbs(factor);
if ( factor == 1.0 || factor == 0.0 )
return;
bool doReplot = false;
const bool autoReplot = plt->autoReplot();
plt->setAutoReplot(false);
for ( int axisId
= 0; axisId <
QwtPlot::axisCnt; axisId
++ ) {
const QwtScaleDiv *scaleDiv
= plt
->axisScaleDiv
(axisId
);
if ( isAxisEnabled(axisId) && scaleDiv->isValid() )
{
plt->setAxisScale(axisId, scaleDiv->lowerBound() * factor , scaleDiv->upperBound() * factor);
doReplot = true;
}
}
plt->setAutoReplot(autoReplot);
if ( doReplot )
plt->replot();
}
void Magnifier::rescale(double factor)
{
factor = qwtAbs(factor);
if ( factor == 1.0 || factor == 0.0 )
return;
bool doReplot = false;
QwtPlot* plt = plot();
const bool autoReplot = plt->autoReplot();
plt->setAutoReplot(false);
for ( int axisId = 0; axisId < QwtPlot::axisCnt; axisId++ )
{
const QwtScaleDiv *scaleDiv = plt->axisScaleDiv(axisId);
if ( isAxisEnabled(axisId) && scaleDiv->isValid() )
{
plt->setAxisScale(axisId, scaleDiv->lowerBound() * factor , scaleDiv->upperBound() * factor);
doReplot = true;
}
}
plt->setAutoReplot(autoReplot);
if ( doReplot )
plt->replot();
}
To copy to clipboard, switch view to plain text mode
Bookmarks