Results 1 to 2 of 2

Thread: QwtPlotZoomer disabled after deep zoom

  1. #1
    Join Date
    Jun 2015
    Posts
    94
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default QwtPlotZoomer disabled after deep zoom

    Hello Everyone,

    I'm using QwtPlotZoomer and QwtPlotMagnifer to zoom in and out,
    If I use deep zoom using QwtPlotZoomer then it gets disabled and never used for zooming even after I zoom out using QwtPlotMagnifier.

    Here is below I have written simple constructor for QwtPlotZoomer to initialize.
    Qt Code:
    1. ZoomPlot::ZoomPlot(QwtPlot *plot):
    2. QwtPlotZoomer(plot->canvas())
    3. {
    4. //setMaxStackDepth(-1);
    5. setTrackerMode(AlwaysOff);
    6. setTrackerPen(QPen(QColor(Qt::blue)));
    7. setRubberBand(QwtPicker::RectRubberBand);
    8. setMousePattern(QwtEventPattern::MouseSelect1,Qt::LeftButton, Qt::ControlModifier);
    9. setMousePattern(QwtEventPattern::MouseSelect2, Qt::NoButton, Qt::NoModifier);
    10. setMousePattern(QwtEventPattern::MouseSelect4,Qt::NoButton,Qt::NoModifier);
    11. setMousePattern(QwtEventPattern::MouseSelect5,Qt::NoButton,Qt::NoModifier);
    12. setMousePattern(QwtEventPattern::MouseSelect6,Qt::NoButton);
    13. }
    14.  
    15. void ZoomPlot::rescale()
    16. {
    17. emit autoScaleDisable(false);
    18. QwtPlotZoomer::rescale();
    19. }
    To copy to clipboard, switch view to plain text mode 

    Can someone explains why it gets disable after deep/multiple zoom in and whats the solution for this?

    Thanks

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

    Default Re: QwtPlotZoomer disabled after deep zoom

    Quote Originally Posted by npatil15 View Post
    Can someone explains why it gets disable after deep/multiple zoom in and whats the solution for this?
    The overall limitation is the significance of doubles: https://de.wikipedia.org/wiki/IEEE_754. But you will probably never have the maximal significance for the tick labels and you will end up sooner or later in having identical values.

    But if you like to disable the feature:

    Qt Code:
    1. class YourZoomer : public QwtPlotZoomer
    2. {
    3. ....
    4.  
    5. QSizeF minZoomSize() const override
    6. {
    7. return QSizeF( -1.0, -1,0 );
    8. }
    9. };
    To copy to clipboard, switch view to plain text mode 
    Note, that you Qwt is open source and you can always help yourself by looking into the code.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    npatil15 (19th February 2019)

Similar Threads

  1. Replies: 4
    Last Post: 12th January 2016, 08:36
  2. Zoom out with QwtPlotZoomer
    By vonheld in forum Newbie
    Replies: 0
    Last Post: 28th August 2015, 01:20
  3. QwtPlotZoomer- problem with zoom out
    By GG2013 in forum Qwt
    Replies: 2
    Last Post: 2nd September 2013, 01:11
  4. Replies: 5
    Last Post: 18th July 2012, 10:17
  5. Replies: 3
    Last Post: 10th October 2011, 17:55

Tags for this Thread

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.