QwtPlotZoomer Problems

  • I have a plot that is made using mostly the bode example as a guideline but now I am adding some other functionality in. Currently the user can select from a list of a few different things what they would like the x and y axis' to display. My code works to update and replot the curve perfectly. The problem I am having though is when the user wants to zoom in to the plot, when they right click to zoom back out the plot has some really weird rescaling issues where the axis' are switched back to default of 0-1000 on each one. I have tried a few different solutions such as deleting the zoomer and recreating it every time a replot is done but nothing seems to work, any ideas?

  • I am having the same problem...

  • Hello, you should apply setZoomBase() after attaching the data

  • Excellent!! I was looking for this for some weeks!!

    The only thing, it's that it goes to the zoom base i set, but previously passing through the 0 - 1000 scale!

    Im going to see if i can fix this!


  • With this function:
    void QwtPlotZoomer::setZoomStack ( const QStack< QRectF > & zoomStack,
    int zoomRectIndex = -1

    You can manually set the zoom stack which helps you select the zoom base and all the other zooms, or with this:
    void QwtPlotZoomer::setZoomBase ( bool doReplot = true )

    You can set the stack's first value directly!

    Good luck with it!!

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.