2 Attachment(s)
Curve color and legend identifier color are not consistent
Hello,
I have a probleme with colors of my curves and the legend identifiers. The color of legend identifier seems to be a composition with the backgroud color of the QwtLegendWidget.
Is it a bad use of QWT or a bug ?
Do you see a workaround ?
Thanks
(Using Qt 4.7 and qwt 6.0.1)
See the used code to create the plot (simplified):
Code:
legend
->setFrameStyle
(QFrame::Box|QFrame
::Sunken);
_plot
->insertLegend
(legend,
QwtPlot::BottomLegend);
See the used code to create curves (simplified) :
Code:
QwtPointSeriesData* seriesData = new QwtPointSeriesData(pointsList);
curve->setData(seriesData);
curve
->setAxes
(QwtPlot::xBottom,getOrdinateId
());
pen.setColor(colorToUse);
pen.setWidth(2);
curve->setPen(pen);
curve->attach(plot);
If I change the line 459 of qwt_plot_item.cpp file, colors are consistent
Original line:
Code:
identifier.fill( Qt::transparent );
Modified line:
Code:
identifier.fill(); // (default value Qt::white)
See attached screenshot (without QWT modification)
Attachment 7612
See attached screenshot (with QWT modification)
Attachment 7613
Re: Curve color and legend identifier color are not consistent
oops, the two screenshots are inverted...
The first (plot_1.jpeg) is WITH QWT modification => The expected behaviour.
And the second is my problem (WITHOUT QWT modification)
Re: Curve color and legend identifier color are not consistent
Please post a small and compilable demo I can check on my system.
Uwe
1 Attachment(s)
Re: Curve color and legend identifier color are not consistent
I have the same problem
Attachment 10011