I'm having an issue trying to draw a watermark-style text using QPainter.

If the underlying device is a QWidget the text is correctly drawn, but if the device is a QPrinter the first line of text always ignores the Opacity. Below is the smallest snippet I could cook that reproduces the issue.

Qt Code:
  1. QString watermarkTex ("Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark Watermark");
  2. QRect painterRect (0,0,painter.device()->width(),painter.device()->height());
  3.  
  4. painter.setOpacity(0.5);
  5. painter.drawText(painterRect,watermarkText);
To copy to clipboard, switch view to plain text mode 

I'm using a long text and relying on word wrap, but the same happens if I use newlines.

This is the output on a QWidget:



And this is the output on a printer ( Foxit PDF Printer in this case, but I have also tested with Microsoft XPS Document Writer and my Epson paper printer with the same result):



I did not find any open bug related to this but I'm not very familiar with the searching options so I might have missed it.

Is this a known issue, am I doing anything wrong or did I discover a new bug?

EDIT: Forgot to mention I'm using Qt 5.9.1