From 71b2de1f1d041ac3a7c932d02b6860c450d7c924 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 14 Dec 2018 09:14:19 +0100 Subject: Windows: Use the ptPaperSize information to set the paper size In some cases the DEVMODE structure is not updated with the selected paper size, whereas the ptPaperSize structure is always set to the right paper size. Therefore we set the page size on the printer to this after the page dialog is shown. Change-Id: Ieafd486232aca6e930f73a8131b7196ddecea305 Reviewed-by: Friedemann Kleint --- src/printsupport/dialogs/qpagesetupdialog_win.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp index 23fff82f25..464381bbe4 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp +++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp @@ -134,6 +134,8 @@ int QPageSetupDialog::exec() QDialog::setVisible(false); if (result) { engine->setGlobalDevMode(psd.hDevNames, psd.hDevMode); + d->printer->setPageSize(QPageSize(QSizeF(psd.ptPaperSize.x / multiplier, psd.ptPaperSize.y / multiplier), + layout.units() == QPageLayout::Inch ? QPageSize::Inch : QPageSize::Millimeter)); const QMarginsF margins(psd.rtMargin.left, psd.rtMargin.top, psd.rtMargin.right, psd.rtMargin.bottom); d->printer->setPageMargins(margins / multiplier, layout.units()); -- cgit v1.2.3