Results 1 to 4 of 4

Thread: QwtPlot::print() curve thickness problem

  1. #1
    Join Date
    Jan 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QwtPlot::print() curve thickness problem

    Hi!

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

    Qt Code:
    1. QPrinter printer( QPrinter::HighResolution );
    2. printer.setOutputFormat( QPrinter::PdfFormat );
    3. printer.setOutputFileName( fileName );
    4.  
    5. qwtPlot()->print(printer);
    To copy to clipboard, switch view to plain text mode 

    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?

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,277
    Thanked 871 Times in 819 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlot::print() curve thickness problem

    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

  3. #3
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Windows

    Default Re: QwtPlot::print() curve thickness problem

    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.

  4. #4
    Join Date
    Jun 2008
    Location
    Boulder, Colorado, USA
    Posts
    70
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlot::print() curve thickness problem

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.