Respect the orientation setting from the page setup dialog

Task-number: QTBUG-27887
Change-Id: I2af7a495c4e693e9519c7e0ffde54b7e6a1d8715
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Andy Shaw 2014-12-01 14:32:45 +01:00 committed by Joerg Bornemann
parent fe1726fd7d
commit 838212b8e6

View File

@ -84,8 +84,11 @@ QT_USE_NAMESPACE
PMPageFormat format = static_cast<PMPageFormat>([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);