Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.0
-
None
Description
I want to export widget contents to PNG, SVG, and PDF depending what the user chooses. Using QWidget::render, exporting to PNG works nicely but when using QSvgGenerator and QPdfWriter, elements outside the QAbstractScrollArea are not correctly clipped. See the attached minimal example.
PNG export:
PDF export, converted to PNG using pdftoppm:
SVG export converted to PNG using ImageMagick:
As can be seen, for both SVG and PDF export, The 6th row and the 3rd column of the table lookg wrong. They should be clipped at the scrollbars. Also the SVG export does not correctly clip the textinside the widgets even though QWidget::render on QPdfWriter does this correctly.
There are other problems, like the light gray rectangle extending below the tab rider, which only is there in the PDF/SVG export. I think, I'll open another issue for this.
There also is a problem with the SVG export's tab rider outline being black for some reason instead of a light gray.