Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.3
-
None
-
Windows 7
Description
Launch the QPageSetupDialog and request the paper size selected by user:
QPageSetupDialog myPageSetupDialog(myQPrinter, this);
if (myPageSetupDialog.exec() == QDialog::Accepted) {
QPrinter::PaperSize size = myQPrinter->paperSize();
QPrinter::paperSize() returns the paper size based on the lookup table in %QTDIR%\src\gui\painting\qprintengine_win.cpp, which rather than mapping some unusual paper sizes to QPrinter::Custom, actually maps them to other paper sizes (function mapDevmodePaperSize(int s) on qprintengine_win.cpp).
This works ok if the original paper size either maps identically or doesn't appear in the table. But if the user selects a paper size that is non-identically mapped, QPrinter::paperSize() returns incorrect paper size. E.g. if 'A4 Extra' selected on QPageSetupDialog --> QPrinter::paperSize() returns 'A4'.
These alternative sizes get returned also if you request the actual dimensions as it maps to the QPrinter::PaperSize alternative before looking up the dimensions.
Note: if QPrintPreviewWidget is used with same QPrinter instance, it returns the paper size correctly (from the DEVMODE structure held inside the QPrinter code hierarchy).
Attachments
Issue Links
- is required for
-
QTBUG-25380 QtPrintSupport - Page Layout Issues
- Open
-
QTBUG-25384 QtPrintSupport - Windows issues
- Open
-
QTBUG-37698 QtPrintSupport - Dialog Issues
- Open