PDA

View Full Version : QwtPlotCurve: wrong color and width when printing



FelixB
16th June 2011, 09:24
Hi,

I have some trouble printing a curve (on a real printer or into a pdf) with correct color and width. The on-screen-view is fine and so is the print preview too. I reproduced the problem with the bode example (win7, Qwt 5.2.1):

when I print the example "as it is", the yellow line is printed black. I can make it printing the correct color by changing
d_crv1->setPen(QPen(Qt::yellow)); into
d_crv1->setPen(QPen(Qt::yellow,1));. The same applies to all pens: there must be an explicit width set to print the color.

but I can't change the width. changing the line into
d_crv1->setPen(QPen(Qt::yellow,10)); makes the line thicker on screen (and also in print preview), but not in the printed result.

does anyone know whats wrong? Am I missing something?

thanks!
Felix

PS: the bode example does not have a print preview. I tested the preview-behaviour with my own project.

TomiBomi
23rd January 2012, 21:21
i have the same problem.
You can see your width = 10 only if you saves this plot as an image e.g. JPG
if you want also to print: load(image) and print(). I can see this width in my pdf file.
but not at runtime ...

wang9658
27th January 2012, 12:49
Maybe fixed in Qwt 6.