PDA

View Full Version : Using QwtLegend to change curve attributes



cnbp173
23rd May 2008, 02:05
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

Weilor
23rd May 2008, 09:24
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