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. compare.png
          103 kB
          David Burson
        2. testwin2.pdf
          3 kB
          David Burson
        3. win_pdf_contrast_sscce_qt484.zip
          1 kB
          David Burson
        4. win_pdf_contrast_sscce.zip
          1 kB
          David Burson
        5. win_pdf_contrast.zip
          4 kB
          David Burson
        6. winpdf484c.pdf
          4 kB
          David Burson

        Activity

          People

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

            Dates

              Created:
              Updated: