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

Qt5 breaks rendering to pdf on Windows, for opacity and transparent QGradient

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6.1
    • GUI: Printing
    • Windows

    Description

      When I render a scene to a QPrinter set to PdfFormat, my QGraphicsItem subclass is rendered wrong on two counts:

      1. opacity appears to be 1.0, no matter what I set it to.
      2. With a QGradient, when I use setColorAt() to set the color to Qt::transparent, it uses black instead.

      Rendering the scene to a QGraphicsView works correctly. But my users need to output to pdf. Rendering to a pdf does not have these issues in Qt 4.8, so it seems like a regression in Qt 5 or I'm missing something I should be doing in Qt 5.

      For an sscce, see https://forum.qt.io/topic/71959/qt5-breaks-rendering-to-pdf-on-windows

      Attachments

        1. winpdf484c.pdf
          4 kB
        2. win_pdf_contrast.zip
          4 kB
        3. win_pdf_contrast_sscce.zip
          1 kB
        4. win_pdf_contrast_sscce_qt484.zip
          1 kB
        5. testwin2.pdf
          3 kB
        6. compare.png
          compare.png
          103 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            johnlayt John Layt
            davidburson David Burson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes