Results 1 to 3 of 3

Thread: QwtPlotZoomer- problem with zoom out

  1. #1
    Join Date
    May 2013
    Location
    Melbourne
    Posts
    36
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QwtPlotZoomer- problem with zoom out

    Hallo,
    Though there's been post previously on more or less similar issue I can't figure out my problem. Any help would be great.

    In my plot I could use zoom-in perfectly okay using left mouse button. But while using right-button to zoom out there is some problem.
    Say, I zoom 2 times: org->stage 1->stage 2. Then on right click once it gets back to stage 1. But when I right click again the plot vanishes, and
    the y-axis scale shows 0-1000. Irrespective of how many times it was zoomed, the last click (right) always shows the same (i.e no plot & 0-1000 scale).


    Qt Code:
    1. class Zoomer: public QwtPlotZoomer
    2. {
    3. public:
    4. Zoomer( int xAxis, int yAxis, QWidget *canvas ):
    5. QwtPlotZoomer( xAxis, yAxis, canvas )
    6. {
    7. setRubberBandPen( QColor( Qt::darkGreen ) );
    8. setTrackerMode( QwtPlotPicker::AlwaysOn );
    9.  
    10. setMousePattern( QwtEventPattern::MouseSelect2,
    11. Qt::RightButton, Qt::ControlModifier );
    12. setMousePattern( QwtEventPattern::MouseSelect3,
    13. Qt::RightButton );
    14. }
    15. ...
    16. };
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotZoomer- problem with zoom out

    0 -> 1000 is the default range of a scale , obviously you have initialized the zoomer before setting the scales. See QwtPlotZoomer::setZoomBase() for how to sync the zoomer with the modified scales.

    Uwe

  3. #3
    Join Date
    May 2013
    Location
    Melbourne
    Posts
    36
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QwtPlotZoomer- problem with zoom out

    Thank you so much Uwe. That was indeed the problem i.e initializing the zoomer before setting the scale. Now it works fine.

Similar Threads

  1. Replies: 5
    Last Post: 18th July 2012, 10:17
  2. Problem with QwtPlotZoomer
    By ch_1992 in forum Qwt
    Replies: 1
    Last Post: 12th April 2012, 01:29
  3. Replies: 3
    Last Post: 10th October 2011, 17:55
  4. Replies: 3
    Last Post: 18th May 2011, 17:56
  5. Replies: 1
    Last Post: 13th May 2011, 19:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.