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

QTextDocument drawContents() and print() use different colors

XMLWordPrintable

    • Windows

      With dark mode enabled, using QTextDocument::drawContents() to get a PDF report result white text on white background. If the PDF report is created calling QTextDocument::print() then the result is black text on white background as expected.
      drawContents() is used instead of print() to add headers and footers including the page numbering.

      It seems that for print() the text color for the used palette is explicitly set to Qt::black. Where for drawContents() the system palette is used. And for dark mode this doesn’t work correctly.

      Attached example can be used to reproduce the issue.

      As a workaround, the color for the application can be changed right before calling drawContents and then set it back after that.

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

            esabraha Eskil Abrahamsen Blomfeldt
            tiheikka Titta Heikkala
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes