PDA

View Full Version : How to change appearance of a legend item?



Maximum
17th February 2010, 14:59
I have implemented my own plot curve class which generates a specialized legend item in legendItem(). Now I want to change the item text/color/label on certain events. E.g. I want to add a "inactive" text to the curve title and/or I want to change the symbol/color.

There is a virtual method QwtPlotCurve::updateLegend(). It is called when a legend is inserted into the plot, but I don't know how to trigger it manually. The documentation of updateLegend() is very short and the method is not used in any example project.

Uwe
20th February 2010, 12:42
Call curve->itemChanged() whenever you want to update the representation on the legend( updateLegend() will be triggered. ).

Uwe

PS: Qwt is open source - why not looking into the source code to see what's going on ?