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

Cosmetic lines (0 width) will not print in colour when painting to QPrinter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.7.0, 5.3.2
    • Fix Version/s: 5.4.0 RC
    • Labels:
      None
    • Environment:
      Windows 7
    • Commits:
      04912b6a3bcff9087d0679b224cfccee3c05bd10

      Description

      When painting to a QPrinter object with a QPainter object, the colour of cosmetic lines is not shown. Instead, they are all printed in black, even with the printer colour mode set to colour (printer.setColorMode(QPrinter::Color)). However, when painting to a QGraphicsView object the colours appear correctly.

      Oddly, it seems that in order for the colour to be shown when painting to the printer object, the line width must be set >= 1. Setting the pen width to 1 is not desirable, as I apply a matrix transform to the painter and always want the line width to only be 1 pixel wide, independent of the transformation set on the painter.

      I would welcome any workaround for this issue.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              andysh Andy Shaw
              Reporter:
              rwaelz Ryan Waelz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes