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:

Qt Code:
  1. void Magnifier::rescale(double factor)
  2. {
  3. factor = qwtAbs(factor);
  4. if ( factor == 1.0 || factor == 0.0 )
  5. return;
  6.  
  7. bool doReplot = false;
  8. QwtPlot* plt = plot();
  9.  
  10. const bool autoReplot = plt->autoReplot();
  11. plt->setAutoReplot(false);
  12.  
  13. for ( int axisId = 0; axisId < QwtPlot::axisCnt; axisId++ )
  14. {
  15. const QwtScaleDiv *scaleDiv = plt->axisScaleDiv(axisId);
  16. if ( isAxisEnabled(axisId) && scaleDiv->isValid() )
  17. {
  18.  
  19. plt->setAxisScale(axisId, scaleDiv->lowerBound() * factor , scaleDiv->upperBound() * factor);
  20. doReplot = true;
  21. }
  22. }
  23.  
  24. plt->setAutoReplot(autoReplot);
  25.  
  26. if ( doReplot )
  27. plt->replot();
  28. }
To copy to clipboard, switch view to plain text mode