I have been trying to print to pdf with incorrect results.
Using the combination of a PdfFormat on a QPrinter, a linear gradient and a scale to draw a rectangle (NoPen) should draw a gradient only, using the right colors.
Without anti-aliasing, lines appear on the top and left corners of the rectangle.
Activating anti-aliasing seems to fix the lines problem but creates a new one where colors becomes dirty in adobe reader (but fine with any other pdf reader). I suspect to bug to be linked to the first one, but may be a separate one.
(try false/true for setRenderHints(QPainter::Antialiasing, ...) to get different results)
Screenshot showing on the:
- left-top: Adobe Reader with Antialiasing to false
- left-right: Adobe Reader with Antialiasing to true
- bottom: Foxit Reader with Antialiasing to true
Lines still appear on Foxit Reader with Antialiasing to false.