mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-15 01:54:14 +02:00
f42958d2c2
The print window exported every page in one orientation, landscape unless changed, so a portrait folio was shrunk onto a landscape page. With "Fit in page" on, a PDF export now turns each page to portrait or landscape as its folio is drawn. The preview keeps one orientation (QPrintPreviewWidget lays out every page at one paper size), and a printer keeps it too (only Qt's PDF engine accepts a new page layout once printing has started). The orientation chosen in the window is put back afterwards, so it is still the one saved. The cross-reference links took their target from painter->viewport(), which QPainter sets once when it opens, so on a turned page they missed their text. They now use the device's size, as render() does. tst_printpdforientation exports through the window: an A3 landscape and an A3 portrait folio get one page each way; tiled pages keep the chosen orientation; and the links on examples/industrial.qet's turned pages land where they do when the export starts portrait. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>