Results 1 to 3 of 3

Thread: QwtPlotCurve: wrong color and width when printing

  1. #1
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    18
    Thanked 68 Times in 66 Posts

    Default QwtPlotCurve: wrong color and width when printing

    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
    Qt Code:
    1. d_crv1->setPen(QPen(Qt::yellow));
    To copy to clipboard, switch view to plain text mode 
    into
    Qt Code:
    1. d_crv1->setPen(QPen(Qt::yellow,1));
    To copy to clipboard, switch view to plain text mode 
    . 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
    Qt Code:
    1. d_crv1->setPen(QPen(Qt::yellow,10));
    To copy to clipboard, switch view to plain text mode 
    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.

  2. #2
    Join Date
    Jan 2012
    Posts
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60
    Thanks
    1

    Default Re: QwtPlotCurve: wrong color and width when printing

    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 ...
    Last edited by TomiBomi; 23rd January 2012 at 23:11.

  3. #3
    Join Date
    Jan 2012
    Location
    ShangHai, PRC of China
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: QwtPlotCurve: wrong color and width when printing

    Maybe fixed in Qwt 6.

Similar Threads

  1. QwtPlotCurve color for connecting lines
    By orignihn in forum Qwt
    Replies: 1
    Last Post: 28th April 2011, 08:08
  2. Replies: 1
    Last Post: 26th May 2010, 12:30
  3. Replies: 1
    Last Post: 30th March 2009, 15:28
  4. QTextEdit wrong color
    By thomaspu in forum Qt Programming
    Replies: 3
    Last Post: 18th January 2008, 05:35
  5. border color is wrong with "plastique" style in Qt4.2.3
    By alfa_wu in forum Qt Programming
    Replies: 2
    Last Post: 30th April 2007, 05:27

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
  •  
Qt is a trademark of The Qt Company.