Issue with using QGraphicsScene::render() with QLinearGradient
-
wrote on 16 May 2024, 11:04 last edited by AndyBrice
I have a QGraphicsScene with various objects representing a table plan. When someone prints I use QGraphicsScene::render() on a QPrinter object to do the printout. This has worked fine in Qt 5 for years. But I have run into an issue with Qt 6 on Windows.
When I QGraphicsScene::render() this:
I get this:
The gradient just stops beyond a certain x value.
It happens if I print to a real printer or a PDF virtual printer. Customers have reported the issue a well, so it isn't just my computer or printer.
If I change the QLinearGradient on the seats or tables to a flat colour, the problem goes away.
The issue occurs with Qt 6.5.5 LTS on Windows 10. Qt 6.5.5 LTS on macOS seems to work ok. The problem does not occur with Qt 5.
Has anyone else seen this? I wanted to check before I spend ages writing a standalone program to reproduce the issue.
-
wrote on 16 May 2024, 14:12 last edited by
Digging further I think it might be that QPrinter::device()->viewport() is not updated when I call:
QPrinter::setPageOrientation( QPageLayout::Landscape );
-
wrote on 20 May 2024, 10:14 last edited by
Just me then?
I still haven't found a solution.
-
wrote on 22 May 2024, 09:46 last edited by
Problem seems to have been fixed in Qt 6.7.1.
2/4