Several issues with QWT 6.1 and Qt 5.0.2
I've encountered some problems compiling my old project that was initially built with Qt 4.8 and Qwt 6.0.2.
- QwtText doesn't have the setBackgroundPen option anymore. What's the correct way to apply a QPen to the background of a QwtText object?
- canvas() is apparently a QWidget object the newer version. Should I simply reassigning all QwtPlotCanvas* objects as QWidget*'s (it seems to do the trick) ?
- The QwtPlotRenderer::KeepFrames option is missing. What alternative can you suggest for the renderer.setLayoutFlag(QwtPlotRenderer::KeepFrames ,true) function?
- The setItemAttribute(QwtPlotItem::Legend,false) option for a QwtPlotCurve is present in the build (previously mentioned issues produce a compilation error) but it doesn't seem to be working properly. I've previously used this function to omit some of the curves from the legend but in this newer build all of the "hidden" curves are visible.
Can someone verify these issues?
Re: Several issues with QWT 6.1 and Qt 5.0.2
Quote:
What's the correct way to apply a QPen to the background of a QwtText object?
QwtText::setBorderPen()
Quote:
canvas() is apparently a QWidget object the newer version. Should I simply reassigning all QwtPlotCanvas* objects as QWidget*'s
The canvas can be a QwtPlotCanvas, a QwtPlotGLCanvas or any other widget you have passed with QwtPlot::setCanvas(), that offers a couple of methods, that are documented there.
Quote:
The QwtPlotRenderer::KeepFrames option is missing.
The default setting is to render WYSWYG as much as possible - what includes the frames as default. In 6.0 rendering of the frames is disabled in the default setting, because it was not implemented properly.
Quote:
The setItemAttribute(QwtPlotItem::Legend,false) option for a QwtPlotCurve is present in the build (previously mentioned issues produce a compilation error) but it doesn't seem to be working properly.
Is intended to work - please upload a small compilable demo demonstrating the situation.
Uwe
2 Attachment(s)
Re: Several issues with QWT 6.1 and Qt 5.0.2
Quote:
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:
Code:
// "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;
}
}
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:
Attachment 8952
whereas in Qwt 6.1 the same exact code generates this:
Attachment 8953
I don't know whether this piece of code is comprehensible enough. I can elaborate more if necessary.
Re: Several issues with QWT 6.1 and Qt 5.0.2
Quote:
Originally Posted by
DizzyMoods
I don't know whether this piece of code is comprehensible enough. I can elaborate more if necessary.
As I said: please upload a small compilable demo.
Uwe