2 Attachment(s)
Curve legend doesn't show a symbol entirely
Hello all,
I faced with a problem that using QwtPlotCurve::LegendShowSymbol doesn't show a symbol (a circle in my case) in a legend entirely:
Attachment 5860
Here is an example code:
Code:
{
public:
private:
};
{
sym->setSize(5);
sym
->setPen
(QColor(Qt
::blue));
_curve.setSymbol(sym);
_curve.setTitle(tr ("Curve"));
_curve.attach(this);
for (unsigned i = 0; i < 10; ++i)
{
x.push_back(i);
}
_curve.setSamples(x, x);
insertLegend
(legend,
QwtPlot::BottomLegend);
}
If I change a symbol size from 5 to 10 everything looks nice:
Attachment 5861
Does anybody know why this can happen?
Thanks for any help!
Re: Curve legend doesn't show a symbol entirely
I can't confirm this on my box.
What version of Qwt/Qt on which platform do you have. Does it still happen with Qwt from SVN trunk ?
Uwe
Re: Curve legend doesn't show a symbol entirely
Yes, it happens with the last Qwt version from SVN trunk.
I use Qt 4.7.0 and platform is Windows 7 Professional.
Re: Curve legend doesn't show a symbol entirely
I've figured it out!
The problem is in using even/odd QwtSymbol sizes.
E.g. it is better to set an even size using a circle (QwtSymbol::Ellipse), and odd size using QwtSymbol::Star1.
Re: Curve legend doesn't show a symbol entirely
Ah o.k. but then the odd size of the ellipse should be also bad on the plot itself ?
Unfortunately I had to rewrite much of the symbol code for Qwt 6 because of the floating point based render engine ( + symbols can be cached in a pixmap, what is sometimes faster ). So I might have introduced bugs in this version.
Uwe
1 Attachment(s)
Re: Curve legend doesn't show a symbol entirely
The ellipse with an odd side looks ok by itself. But if I put a circle with an odd size in a circe with an even size there is a problem that the inner circle looks asymmetrical:
Attachment 5872
Code:
sym1->setSize(14);
sym1
->setPen
(QColor(Qt
::blue));
_curve1.setSymbol(sym1);
_curve1.attach(this);
_curve2.setSymbol(sym2);
_curve2.attach(this);
for (unsigned i = 0; i < 10; ++i)
{
x.push_back(i);
}
_curve1.setSamples(x, x);
_curve2.setSamples(x, x);