Results 1 to 6 of 6

Thread: quick help:cannot initialize the zoomer into a specific rect

  1. #1
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default quick help:cannot initialize the zoomer into a specific rect

    Hi,
    When I am loading a new plot I try to have the zoom directly zoomed in a specific area:QRectF currentRect:
    Qt Code:
    1. QRectF currentRect(topleft,bottomright);
    2. m_zoomer->setEnabled(true);
    3. m_zoomer->setZoomBase(currentRect);
    4. //m_zoomer->setZoomBase( true) ; I tried this as well
    5. myPlot->replot();
    To copy to clipboard, switch view to plain text mode 
    However the the zoomer does not go to that area, it does nothing.
    Probably I am missing an important zoomer funciton!
    Any help?

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

    Default Re: quick help:cannot initialize the zoomer into a specific rect

    The zoomer is not the API for setting the scales - it is an object intended for user interactions !

    Qt Code:
    1. myPlot_>setAxisScale(
    2. QwtPlot::xBottom, topleft.x(), bottomright.x() );
    3. myPlot->setAxisScale(
    4. QwtPlot::yLeft, topleft.y(), bottomright().y() ); // or v.v.
    5. myPlot->replot();
    6.  
    7. // If you really want to have one reinitialize
    8. // the zoomer with the current scales
    9.  
    10. m_zoomer->setZoomBase( false );
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    fatecasino (10th March 2011)

  4. #3
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: quick help:cannot initialize the zoomer into a specific rect

    thanks,

    I just want to activate a "save as..." option, so when the user quits from working with a plot he can save the current zoom and load it up from a file. That's the reason I would like to have the zoomer focused to a specific area.
    thanks!

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

    Default Re: quick help:cannot initialize the zoomer into a specific rect

    No, you want to save the current scales - the zoomer is only a helper class, that manipulates the scales.

    Uwe

  6. #5
    Join Date
    Nov 2010
    Posts
    142
    Thanks
    24
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: quick help:cannot initialize the zoomer into a specific rect

    No, you want to save the current scales - the zoomer is only a helper class, that manipulates the scales.
    Do you mean this combination of functions? (for 2 axis)
    Qt Code:
    1. //saving the current scales
    2. QwtScaleEngine * axisScaleEngine (0)
    3. QwtScaleEngine * axisScaleEngine (1)
    4. //loading saved scales
    5. void setAxisScaleEngine (int axisId, QwtScaleEngine *)
    6. void setAxisScaleEngine (int axisId, QwtScaleEngine *)
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: quick help:cannot initialize the zoomer into a specific rect

    Quote Originally Posted by fatecasino View Post
    Do you mean this combination of functions?
    Oh no - what makes you believe, that changing the scale engine has something to do with what I wrote.

    Once more - please read the documentation.

    Uwe

Similar Threads

  1. Replies: 5
    Last Post: 14th February 2011, 14:06
  2. how to get zoomer to replot
    By kja in forum Newbie
    Replies: 3
    Last Post: 17th November 2010, 07:15
  3. Problem with Zoomer
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 10th March 2010, 12:35
  4. zoomer in spectrogram example
    By rambo83 in forum Qwt
    Replies: 0
    Last Post: 1st December 2009, 09:06
  5. how could the value in every grid after zoomer?
    By matt_atlantis in forum Qwt
    Replies: 1
    Last Post: 29th July 2009, 01:26

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.