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):
legend
->setFrameStyle
(QFrame::Box|QFrame
::Sunken);
_plot
->insertLegend
(legend,
QwtPlot::BottomLegend);
_plot = new QwtPlot();
QwtLegend* legend = new QwtLegend;
legend->setFrameStyle(QFrame::Box|QFrame::Sunken);
_plot->insertLegend(legend, QwtPlot::BottomLegend);
To copy to clipboard, switch view to plain text mode
See the used code to create curves (simplified) :
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);
QwtPlotCurve* curve = new QwtPlotCurve(QString(resultName.c_str()));
QwtPointSeriesData* seriesData = new QwtPointSeriesData(pointsList);
curve->setData(seriesData);
curve->setAxes(QwtPlot::xBottom,getOrdinateId());
QPen pen;
pen.setColor(colorToUse);
pen.setWidth(2);
curve->setPen(pen);
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:
identifier.fill( Qt::transparent );
identifier.fill( Qt::transparent );
To copy to clipboard, switch view to plain text mode
Modified line:
identifier.fill(); // (default value Qt::white)
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
Bookmarks