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
Re: Using QwtLegend to change curve attributes
Everything you asked can be found by taking a look in the docs. Anyway, here you are:
Quote:
I was wondering if you could set the same LegendItems to clickable
Have a look at QwtLegend::setItemMode()
Quote:
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