Images are drawn using a custom QGraphicsItem with a paint() method which a) adjusts the current world transform to flip the image and b) paints the image using QPainter::drawPixmap(). It is the sign of the scale factors applied in (a) which seems to be ignored.
The attached example demonstrates the issue. On the screen the word 'Hello' appears with the correct orientation, as the world transform correctly flips the QPixmap from top-to-bottom.
When sent to the printer (either a real printer or 'to file') 'Hello' is not transformed, so it appears upside down.