Results 1 to 7 of 7

Thread: QwtPlotMagnifier initial zoom

  1. #1
    Join Date
    Sep 2008
    Posts
    26
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QwtPlotMagnifier initial zoom

    Hello,

    I am using a QwtPlotMagnifier but I don't find the way to set the zoom for initial zoom (similar to zoombase when using QwtPlotZoomer) ...

    Somebody has any suggestion ?

    Thanks in advance,

    Joel.

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

    Default Re: QwtPlotMagnifier initial zoom

    What do you expect from something like an "initial zoom" ?

    Uwe

  3. #3
    Join Date
    Sep 2008
    Posts
    26
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotMagnifier initial zoom

    Hi Uwe,

    Thanks for your reply !
    I have a class that inherits QwtPlot and that displays some geometric entities. I am able to compute a "bounding box" for all these geometric entities (ie xmax, ymax, xmin, ymin).

    I'm using QwtPlotMagnifier to handle zooming. I would like to set the initial value of the zoom of the QwtPlotMagnifier so that all the geometric entities are shown (ie ensure that xmax, ymax, xmin, ymin are displayed on the plot)

    I hope my question is a little bit more clear now ...

    Thank's in advance,

    Joel.

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

    Default Re: QwtPlotMagnifier initial zoom

    No it isn't: setting the scales is done by QwtPlot::setAxisScale. QwtPlotMagnifier changes these scales according to wheel events and the current scale ranges ( calling QwtPlot::setAxisScale() ). QwtPlotZoomer does it similar - beside, that it has a history ( zoomStack ), where you can step back/forward,

    But what do you expect from an initial state of a magnifier ?

    Uwe

  5. #5
    Join Date
    Sep 2008
    Posts
    26
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotMagnifier initial zoom

    Hi Uwe,

    Thanks for you reply.

    What I would expect from an initial state of a magnifier would be that all the entity attached to the QwtPlot are displayed.

    Actually, the initial view is a full zoom on one curve ... but maybe it's not the normal behavior and there is somethig wrong in my code !!

    I will see if I can compute a scale factor to apply using QwtPlot::setAxisScale() so that I can ensure that my bounding box is shown in the QwtPlot ...

    Best regards,

    Joel.

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

    Default Re: QwtPlotMagnifier initial zoom

    Quote Originally Posted by jomarin View Post
    What I would expect from an initial state of a magnifier would be that all the entity attached to the QwtPlot are displayed.
    This is the initial state of the axes scales you get when you enable autoscaling.
    The plot has a state, but a magnifier is stateless - its simply a manipulator (translating wheel events into axis scale changes ) of the plot scales.

    Uwe

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

    jomarin (6th May 2010)

  8. #7
    Join Date
    Sep 2008
    Posts
    26
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotMagnifier initial zoom

    Thanks Uwe,

    I did not understand why I did not get all my entities displayed when enabling autoscaling, but using :

    setAxisScale(QwtPlot::xBottom,minZoomRect.left(),m inZoomRect.right());
    setAxisScale(QwtPlot::yLeft,minZoomRect.bottom(),m inZoomRect.top());

    It works perfect for me

Similar Threads

  1. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 16:16
  2. Replies: 1
    Last Post: 16th November 2009, 05:25
  3. QwtPlotMagnifier Invert Wheel Zoom
    By jmsbc in forum Qwt
    Replies: 2
    Last Post: 12th March 2009, 23:12
  4. QGLWidget with text - zoom in / zoom out
    By h123 in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 09:56
  5. Problem with the QwtPlotMagnifier
    By seguprasad in forum Qwt
    Replies: 8
    Last Post: 6th December 2007, 11:11

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.