Results 1 to 5 of 5

Thread: Qwt Legend

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11

    Arrow Qwt Legend

    hello,

    i was observing the cpu plot example. On executing the binary i noticed that the "user" and the "system" legend items were already checked and the corresponding curves were shown. However i would like only one curve to be shown when the widget starts.

    1. How do i change this default behavior ?
    2. Secondly, when a legend item is clicked..say "total" i would like the previous selection to be unchecked automatically. This does not happen in the example.

    The code looks something like this:

    Qt Code:
    1. connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool)),
    2. SLOT(showCurve(QwtPlotItem *, bool)));
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. void CpuPlot::showCurve(QwtPlotItem *item, bool on)
    2. {
    3. item->setVisible(on);
    4. QWidget *w = legend()->find(item);
    5. if ( w && w->inherits("QwtLegendItem") )
    6. ((QwtLegendItem *)w)->setChecked(on);
    7.  
    8. replot();
    9. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by maxpayne; 14th October 2008 at 13:40.

Similar Threads

  1. problem installing qwt 5.1.1 on linux for ARM
    By raman_31181 in forum Qwt
    Replies: 4
    Last Post: 18th August 2010, 14:51
  2. QWT introduction
    By nitriles in forum Qwt
    Replies: 4
    Last Post: 28th September 2007, 10:48
  3. Qwt 5.0.2
    By Uwe in forum Qt-based Software
    Replies: 1
    Last Post: 20th September 2007, 18:21
  4. How to upgrade Qwt 5.0.1 to Qwt 5.0.2
    By luffy27 in forum Qwt
    Replies: 1
    Last Post: 15th July 2007, 19:55
  5. use interesting QWT Library with QT3.X
    By raphaelf in forum Qwt
    Replies: 2
    Last Post: 23rd January 2006, 11:24

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
  •  
Qt is a trademark of The Qt Company.