diff options
author | Andy Shaw <andy.shaw@qt.io> | 2018-12-14 09:14:19 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2018-12-18 20:26:10 +0000 |
commit | 71b2de1f1d041ac3a7c932d02b6860c450d7c924 (patch) | |
tree | 828210b826fad97ec4e99702722868689b746af9 /src/printsupport | |
parent | 7fc427ba23a624a433d93e1c604d870656835305 (diff) |
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 <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/printsupport')
-rw-r--r-- | src/printsupport/dialogs/qpagesetupdialog_win.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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()); |