PDA

View Full Version : QwtlegendLabel checked setItemMode resets isDown



infingy
18th September 2014, 15:27
When a QwtLegendLablel is checked I change the color of the curve which causes a change in the item mode of the label.
Before changing the color the label was down but because of the call of setItemMode the label is reset "d_data->isDown = false;"
Is this a bug? Why can't I change the itemMode without resetting the up/down state of the label?

I hope my description is not too confusing...

Uwe
19th September 2014, 08:56
When a QwtLegendLablel is checked I change the color of the curve which causes a change in the item mode of the label.
The default implementation of QwtPlotItem::legendData() doesn't set the ModeRole and the mode of the label is set to QwtLegend::defaultItemMode(). In this constellation the item mode doesn't change, when updating the curve pen.
Even if you have overloaded QwtPlotItem::legendData() returning a ModeRole ( what makes sense, when you need legend labels with different modes ) I don't see how the item mode might change - beside it is manually done in your code somewhere.

Maybe post some code demonstrating the issue ?

Uwe