PDA

View Full Version : QwtPlot::print() curve thickness problem



aleks
12th January 2009, 14:17
Hi!

I'm trying to print a QwtPlot to a .pdf file. The code is:



QPrinter printer( QPrinter::HighResolution );
printer.setOutputFormat( QPrinter::PdfFormat );
printer.setOutputFileName( fileName );

qwtPlot()->print(printer);


The resulting .pdf file is as expected, except from the line thickness of the curves. All curves are printed with a line thickness of 1, regardless of which QPen the curves are using.

Have anyone experienced the same problem, or know how to fix it?

Uwe
12th January 2009, 22:04
The pen width of the curves is the same as on screen, but they look too thin - because the resolution of your paint device is much higher.

You can argue, that the curves should look like on screen and I would agree for a width like 10. But I'm not sure if everyone wants to have scaled pens for a pen of width 1.

I'm afraid the only one who can decide what to do is the application and an additional API is required to control this. For the moment you have to download Qwt from SVN ( 5.1 branch ) and enable the SCALE_PEN define in qwt_plot_curve.cpp.

Uwe

pirncypeter
12th January 2011, 03:40
The pen width or curves of it is same as a screen, because of its resolutions of using paint resolutions of paint device and it is higher. The curves look like very big on the screen. Better to keep its width more than 5 and less than 10.

philw
29th September 2013, 18:51
See also Uwe's response regarding Qwt 6 in this thread ... http://www.qtcentre.org/threads/56386-Printing-sufficient-curve-thickness-requires-explicit-increase-of-curve-line-width ... "Thread: Printing sufficient curve thickness requires explicit increase of curve line width?" [9-29-2013].