Fix incorrect paper size selection caused by Qt changes

Since moving to Qt 6, page sizes are arbitrarily mapped to other page sizes when printing via the portal.

This has been reported as a "scaling" issue, (KDE, Inkscape) presumably because other parts of the printing stack resize the document to fit the actual paper in the printer. However, printing to PDF reveals the actual issue: the document produced uses a different page size from the one requested.

This happened because Qt6 re-ordered the enum QPageSize::PageSizeId. The issue may have escaped detection because it tends to manifests differently in different countries! Letter maps to A4, producing a scale difference you'd need a ruler to detect, but A4 maps to A2, causing everything to print at half size.

I have split this fix in to three commits, in case you only want part of it.

The first one is the actual fix, and updates qt_pageSizes[] to match Qt 6.

The second one changes struct StandardPageSize to mirror Qt's move to bit fields. I haven't looked closely enough at how the struct is used to know whether this matters; it works fine either way on my machine.

The third one adds a warning comment.

While this merge request does fix the immediate problem, there are other parts of the file which I believe could be made more resilient to Qt changes, and I hope to prepare a second merge request in a few days to address this.

Merge request reports

Loading