Results 1 to 5 of 5

Thread: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot

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

    Default setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot

    Hello,

    I have design the graph using Qwt libraries in which I have multiple curves.
    And this graph is automatically replot itself as per the curves inputs, i.e. changes the X-Y scale of plot.

    Now when I use QwtPlotZoomer, it has default zoomBase() as QRectF(0,0 1000x1000).
    And during autoscale if I use my mouse key to go out of zoom stack it comes to the value of zoomBase. At this point my graph curve is hidden somewhere as its looks too small in this big scale.

    So my intention to set zoomBase with the sale of autoScale of QwtPlot, so that when I came back of zoom then I should be at scale of autoScale, not at default scale.

    Hope I'm able to explain my issue,

    Thanks.

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

    Default Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot

    Quote Originally Posted by npatil15 View Post
    So my intention to set zoomBase with the sale of autoScale of QwtPlot, so that when I came back of zoom then I should be at scale of autoScale, not at default scale.
    O.k. there is is QwtPlotZoomer::setZoomBase - but what is the question ?

    Uwe

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

    Default Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot

    As we know, if we set setAxisAutoScale(QwtPlot::xBottom, true);, then X-axis plot will be autoscale as per the input curves. so now practically my zoomBase should be the current/updated scale interval of x and y axis, not the QRectF(0,0 1000x1000). So my intention is to do like this below, which is not the correct syntax.

    Qt Code:
    1. class ZoomPlot: public QwtPlotZoomer
    2. {
    3. private:
    4. virtual void rescale() override;
    5. QwtPlot *m_plot;
    6. }
    7.  
    8. ZoomPlot::ZoomPlot(QwtPlot *plot):
    9. QwtPlotZoomer(plot->canvas())
    10. {
    11. m_plot = plot;
    12. }
    13.  
    14.  
    15. void ZoomPlot::rescale()
    16. {
    17. if(zoomRectIndex() == 0)
    18. {
    19. setZoomBase(m_plot->axisInterval(QwtPlot::xBottom)) //Its not correct, so looking for correct syntax
    20. }
    21. QwtPlotZoomer::rescale();
    22. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by npatil15; 21st February 2019 at 10:30.

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,199
    Thanked 847 Times in 796 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot

    Qt Code:
    1. setZoomBase( scaleRect() );
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    Default Re: setZoomBase() of QwtPlotZoomer with value of autoReplot scale of QwtPlot

    The return value of scaleRect() will surely worked as per my expectation,
    But I have tried this, and its crashing the application when it hits this logic.

Similar Threads

  1. scale in QwtSlider and QwtPlot
    By mastupristi in forum Qwt
    Replies: 3
    Last Post: 20th October 2014, 07:37
  2. QwtPlotZoomer->setZoomBase
    By gronerth in forum Qwt
    Replies: 2
    Last Post: 24th January 2014, 16:01
  3. How to hide part of a QwtPlot scale?
    By Momergil in forum Qwt
    Replies: 2
    Last Post: 6th February 2013, 19:41
  4. QwtPlotZoomer not to change the yAxis scale
    By dontgonearthecastle in forum Qwt
    Replies: 6
    Last Post: 14th January 2013, 08:43
  5. Replies: 2
    Last Post: 30th December 2010, 17:32

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.