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):
Qt Code:
  1. _plot = new QwtPlot();
  2.  
  3. QwtLegend* legend = new QwtLegend;
  4. legend->setFrameStyle(QFrame::Box|QFrame::Sunken);
  5. _plot->insertLegend(legend, QwtPlot::BottomLegend);
To copy to clipboard, switch view to plain text mode 

See the used code to create curves (simplified) :
Qt Code:
  1. QwtPlotCurve* curve = new QwtPlotCurve(QString(resultName.c_str()));
  2. QwtPointSeriesData* seriesData = new QwtPointSeriesData(pointsList);
  3. curve->setData(seriesData);
  4. curve->setAxes(QwtPlot::xBottom,getOrdinateId());
  5.  
  6. QPen pen;
  7. pen.setColor(colorToUse);
  8. pen.setWidth(2);
  9. curve->setPen(pen);
  10. curve->attach(plot);
To copy to clipboard, switch view to plain text mode 


If I change the line 459 of qwt_plot_item.cpp file, colors are consistent
Original line:
Qt Code:
  1. identifier.fill( Qt::transparent );
To copy to clipboard, switch view to plain text mode 
Modified line:
Qt Code:
  1. identifier.fill(); // (default value Qt::white)
To copy to clipboard, switch view to plain text mode 

See attached screenshot (without QWT modification)
plot_1.jpg

See attached screenshot (with QWT modification)
plot_2.jpg