Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.13.1
-
None
-
Windows 10
Description
When setting the orientation to landscape mode in the QPageLayoutDialog on Windows10, the width and height of the page size are swapped. The layout id changes f.e. to the"A4 rotated" format or "Custom" if not supported by the printer. This bug could not be reproduced on Linux or macOS. The portrait mode works fine and the QPrinter::orientation is set correctly.
Reproducable with Qt's Font Sampler Example:
I added some output to the MainWindow::printDocument function:
void MainWindow::printDocument(QPrinter *printer) { QPageLayout layout = printer->pageLayout(); qDebug() << "Orientation:" << layout.orientation(); qDebug() << "Page Size:" << layout.pageSize(); qDebug() << "Full Rect:" << layout.fullRect(); qDebug() << endl; ...
After starting the example program, selecting a font and then clicking File->Print Preview... in the menu bar, the default output is:
Then open the page layout menu (left from the print button) and press OK with the orientation set to landscape mode ("Querformat" in this screenshot).
Now the page width & height are swapped while the orientation is still the same. You can also see that the orientation buttons in the upper toolbar are still set to landscape (as they should).