Results 1 to 2 of 2

Thread: Using QwtLegend to change curve attributes

  1. #1
    Join Date
    May 2008
    Posts
    25
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Using QwtLegend to change curve attributes

    Hi all,

    I've followed the example that shows how to switch on/off plots, by using the LegendItems and making the Items checkable.

    I was wondering if you could set the same LegendItems to clickable and then change the curve attributes (i.e. width, color, style, etc)

    At the moment I can select the appropriate Item, but don't know how to translate this grabbing the correct QwtPlotCurve pointer, as I have more than one QwtPlotCurve pointers allocated.

    Any help would be appreciated.

    Robbie
    Last edited by cnbp173; 23rd May 2008 at 01:19.

  2. #2
    Join Date
    Jan 2006
    Location
    Hannover, Germany
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using QwtLegend to change curve attributes

    Everything you asked can be found by taking a look in the docs. Anyway, here you are:

    I was wondering if you could set the same LegendItems to clickable
    Have a look at QwtLegend::setItemMode()

    At the moment I can select the appropriate Item, but don't know how to translate this grabbing the correct QwtPlotCurve pointer
    Use the Signal QwtPlot::legendClicked(QwtPlotItem *plotItem) and connect it to any custom slot. Then you can do anything you want with the pointer you get.

    Regards,
    Weilor

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.