Results 1 to 3 of 3

Thread: Dont work replot() after using zoom

  1. #1
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Dont work replot() after using zoom

    Hellow!, i have one problem, for example i have QwtPlot, 2 curve and zoom
    1 curve: graph of function: x^2
    2 curve: graph of function: x^3
    If i add 1 curve and after it 2 curve program called replot() and change size canvas inside the plot:
    b03ab41728d2f8993ec75bfd3867d69e.jpg
    But if 1 add 1 curve, after it use zoom, program dont change size canvas inside the plot
    8dda6827df98d91a26c9991f1a61ac89.jpg

    This function i called when i want to add some graph
    Qt Code:
    1. void RGraphics::setGraphics()
    2. {
    3. graphicsPlot->enableZoomMode(false);
    4. //this->getFunctionListWidget()->getZoomButton()->setChecked(false);
    5.  
    6. //Delete all items
    7. graphicsPlot->detachItems();
    8. graphicsPlot->drawGrid();
    9.  
    10. /***************
    11.   *** Add curve ***
    12.   */**************
    13.  
    14. graphicsPlot->replot();
    15. graphicsPlot->getZoomer()->setZoomBase();
    16. }
    To copy to clipboard, switch view to plain text mode 
    Zoom code i copy from qwt example:
    Qt Code:
    1. //Zoom
    2. d_zoomer[0] = new Zoomer( QwtPlot::xBottom, QwtPlot::yLeft,
    3. this->canvas());
    4. d_zoomer[0]->setRubberBand(QwtPicker::RectRubberBand);
    5. d_zoomer[0]->setRubberBandPen(QColor(Qt::blue));
    6. d_zoomer[0]->setTrackerMode(QwtPicker::ActiveOnly);
    7. d_zoomer[0]->setTrackerPen(QColor(Qt::white));
    8.  
    9. d_zoomer[1] = new Zoomer(QwtPlot::xTop, QwtPlot::yRight,this->canvas());
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. void RGraphicsPlot::enableZoomMode(bool on)
    2. {
    3. d_panner->setEnabled(on);
    4.  
    5. d_zoomer[0]->setEnabled(on);
    6. d_zoomer[0]->zoom(0);
    7.  
    8. d_zoomer[1]->setEnabled(on);
    9. d_zoomer[1]->zoom(0);
    10.  
    11. d_picker->setEnabled(!on);
    12.  
    13. if(!on)
    14. this->setAutoReplot(true); //I try to use it, but it is dont help
    15. }
    To copy to clipboard, switch view to plain text mode 
    In advance thank you for your help!

  2. #2
    Join Date
    Feb 2011
    Location
    Bangalore
    Posts
    207
    Thanks
    20
    Thanked 28 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dont work replot() after using zoom

    Autoscaling is switched off for all axes once you explicitly setAxisScale or use a zoomer to do the same. You need to call QwtPlot::setAxisAutoScale(int axisid) if you want your axes to be auto-scaled and the curves visible.

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

    ruzik (25th September 2011)

  4. #3
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Dont work replot() after using zoom

    Thank you for your help!

Similar Threads

  1. QWidget -> updateGeometry dont work.
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 22nd May 2013, 16:55
  2. Replies: 1
    Last Post: 8th April 2011, 14:45
  3. Replies: 1
    Last Post: 4th February 2011, 07:56
  4. QWTPlot Zoom: cannot zoom negative value
    By jwieland in forum Qwt
    Replies: 0
    Last Post: 8th January 2010, 17:16
  5. Problem with QtBrowserPlugin - examples dont work.
    By robert_ugo in forum Installation and Deployment
    Replies: 0
    Last Post: 19th March 2009, 20:07

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.