Results 1 to 4 of 4

Thread: QWT remove a legnd

  1. #1
    Join Date
    Oct 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QWT remove a legnd

    Hi,

    I set a legend in a QWtPlot
    This legend shows 3 différents curves
    I want to remove one of them from the legend widget. In the previous Qwt version 6.0.0 I use "legend->remove(curve)"
    But in the last version 6.1.0, remove function disapear. How can I replace it, 'm looking for since few hours...
    Thank a lot for your help

  2. #2
    Join Date
    Dec 2013
    Location
    Toronto, Canada
    Posts
    62
    Thanked 16 Times in 15 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QWT remove a legnd

    I want to remove one of them from the legend widget
    may be ...
    curve1->setItemAttribute(QwtPlotItem::Legend, false);


    Added after 33 minutes:


    or...

    QwtPlotCurve * curve1
    ...

    QVariant itemInfo = plot->itemToInfo ( curve1 );
    QWidget *lw = legend->legendWidget (itemInfo);
    lw->hide();
    Last edited by Cah; 17th March 2014 at 05:18.

  3. #3
    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: QWT remove a legnd

    Setting QwtPlotItem::Legend to false is the solution. The second idea ( also what you used with 6.0.0 ) is only a temporary, where the entry would reappear with every replot.

    Uwe

  4. #4
    Join Date
    Oct 2008
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWT remove a legnd

    Thank a lot, that works.

Similar Threads

  1. how to remove .ini file
    By rahulgogoi in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2011, 14:27
  2. remove row of QFormLayout
    By jorg in forum Newbie
    Replies: 1
    Last Post: 31st January 2011, 05:19
  3. Remove an item
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 16th September 2009, 07:47
  4. How to remove background
    By kawazoe in forum Qt Programming
    Replies: 28
    Last Post: 20th May 2007, 01:48

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.