Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12263

QPrinter: rendered composition contains blacked out background when the painter is rendered onto a printer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.1
    • 4.6.3
    • GUI: Printing
    • None
    • Windows 7
    • b377ab9548f8f2500f52175668fdbcd0951b1a7b, bdcfcc607c1a6744cf1b35eca0914fa96e70071c

    Description

      It's not clear whether this problem is with QPrinter or QPainter. The symptoms are that when rendering onto a printer and the composition is created using Qt::NoPen set on the painter, the background appears to be blacked out and to encompass the combined overlapping QPainterPath bounding rects, filled with black.

      This can be reproduced using the attached code sample on Windows. I tested it on Windows 7 and I used the Microsoft XPS printer to view the output (the same should occur using a physical printer).

      To see the problem, run the attached sample and select each case from the menu. The first option uses a solid line for the pen. The second uses Qt::NoPen. It's the second option which displays the strange artifacts.

      In testing this, I also uncovered some problems with setting the printer output to PDF format (by supplying a suitable file name to the QPrinter and by commenting out the print dialog code. Saving directly to a PDF file results in a different shade of green in each case. i.e. in case 1, an olive green was observed, whereas in case 2 a bright green. This may or may not be related but since the same factor seems to contribute to the difference, it seems as though it is.

      This was also tested on Mac but the problem did not manifest in this case.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kjernase Trond Kjernåsen (Inactive)
              cattell Matthew Cattell (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes