From 838212b8e692add300774ffb012dc90342a3130e Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 1 Dec 2014 14:32:45 +0100 Subject: [PATCH] Respect the orientation setting from the page setup dialog Task-number: QTBUG-27887 Change-Id: I2af7a495c4e693e9519c7e0ffde54b7e6a1d8715 Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- src/printsupport/dialogs/qpagesetupdialog_mac.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm index 7180c01df4..f0f9250434 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm @@ -84,8 +84,11 @@ QT_USE_NAMESPACE PMPageFormat format = static_cast([printInfo PMPageFormat]); PMRect paperRect; PMGetUnadjustedPaperRect(format, &paperRect); + PMOrientation orientation; + PMGetOrientation(format, &orientation); QSizeF paperSize = QSizeF(paperRect.right - paperRect.left, paperRect.bottom - paperRect.top); printer->printEngine()->setProperty(QPrintEngine::PPK_CustomPaperSize, paperSize); + printer->printEngine()->setProperty(QPrintEngine::PPK_Orientation, orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait); } dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);