Originally Posted by
Uwe
Is intended to work - please upload a small compilable demo demonstrating the situation.
Well the code might be a bit messy but it goes like this:
// "number" is an integer that numerates a PlotCurve; "PlotCurve" is a "QwtPlotCurve **PlotCurve";
switch(number%4)
{
case 1:
{
PlotCurve
[number
]->setItemAttribute
(QwtPlotItem::Legend,
false);
pen.setStyle(Qt::DashLine);
break;
}
case 2:
{
PlotCurve
[number
]->setItemAttribute
(QwtPlotItem::Legend,
false);
pen.setStyle(Qt::DotLine);
break;
}
case 3:
{
PlotCurve
[number
]->setItemAttribute
(QwtPlotItem::Legend,
false);
pen.setStyle(Qt::DashDotLine);
break;
}
default:
{
break;
}
}
// "number" is an integer that numerates a PlotCurve; "PlotCurve" is a "QwtPlotCurve **PlotCurve";
switch(number%4)
{
case 1:
{
PlotCurve[number]->setItemAttribute(QwtPlotItem::Legend,false);
pen.setStyle(Qt::DashLine);
break;
}
case 2:
{
PlotCurve[number]->setItemAttribute(QwtPlotItem::Legend,false);
pen.setStyle(Qt::DotLine);
break;
}
case 3:
{
PlotCurve[number]->setItemAttribute(QwtPlotItem::Legend,false);
pen.setStyle(Qt::DashDotLine);
break;
}
default:
{
break;
}
}
To copy to clipboard, switch view to plain text mode
Basically I use this function to assign the same colored legend item for 4 different curves (that have different styles). In Qwt 6.0.1-2 it looks like this:
qwt602.jpg
whereas in Qwt 6.1 the same exact code generates this:
qwt610.jpg
I don't know whether this piece of code is comprehensible enough. I can elaborate more if necessary.
Bookmarks