Results 1 to 4 of 4

Thread: remove of all QwtPlotCurves

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question remove of all QwtPlotCurves

    Hi I was trying to remove all curves from QwtPLot...I did not succed (otherwise I wouldnt write here )
    I thought this would do that for me:
    Qt Code:
    1. trendPlot->detachItems(QwtPlotItem::Rtti_PlotCurve, true);
    To copy to clipboard, switch view to plain text mode 
    I was wrong...so I tried to reimplement detachItems method...but did not succed ...
    Anyone help pls ?
    Thanks

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

    Default Re: remove of all QwtPlotCurves

    Guess you simply forgot to call replot() to make your changes happen. You can also enable the autoReplot flag, but this might lead to too many updates.

    Uwe

  3. #3
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: remove of all QwtPlotCurves

    Quote Originally Posted by Uwe View Post
    Guess you simply forgot to call replot() to make your changes happen. You can also enable the autoReplot flag, but this might lead to too many updates.
    Uwe
    Thanks a lot man...that replot() thing helped...
    Can I ask you another question about that QwtPlotZoomer ?
    I have reimplemented it as you advised me to:

    Qt Code:
    1. connect(zoomToolButton, SIGNAL(toggled(bool)), SLOT(enableZoomMode(bool)));
    2.  
    3. void MainWindow::enableZoomMode(bool on)
    4. {
    5. dataPanner->setEnabled(on);
    6.  
    7. dataZoomer[0]->setEnabled(on);
    8. dataZoomer[0]->setZoomBase();
    9.  
    10. dataZoomer[1]->setEnabled(on);
    11. dataZoomer[1]->setZoomBase();
    12.  
    13. dataPicker->setEnabled(!on);
    14. }
    To copy to clipboard, switch view to plain text mode 

    It works just fine...the only SIMPLE problem I suppose is that now when I do some zooming...and then when I toggle the button to "get out/cancel" the zooming the plot does not return to the original state as it was displayed before zooming...
    Have any ideas ?
    Thanks

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

    Default Re: remove of all QwtPlotCurves

    Qt Code:
    1. void MainWindow::enableZoomMode(bool on)
    2. {
    3. ...
    4. if ( on ) {
    5. dataZoomer[0]->setEnabled(on)
    6. dataZoomer[0]->setZoomBase();
    7. }
    8. else {
    9. dataZoomer[0]->zoom(0); // zoom out
    10. dataZoomer[0]->setEnabled(on);
    11. }
    12. ...
    13. }
    To copy to clipboard, switch view to plain text mode 

    Uwe

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

    gyre (21st December 2007)

Similar Threads

  1. Replies: 6
    Last Post: 13th February 2014, 13:46
  2. Remove QSizeGrip/Size Grip from a QWidget or QDialog?
    By Cheetah in forum Qt Programming
    Replies: 1
    Last Post: 5th November 2007, 17:35
  3. Remove a QLayout from QGridLayout
    By grosem in forum Qt Programming
    Replies: 18
    Last Post: 2nd January 2007, 12:19
  4. QRegExp Help; remove all html tag
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 27th July 2006, 14:40
  5. QSettings again ... how to remove array elements
    By Mike in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2006, 09:58

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.