diff options
author | Andy Shaw <andy.shaw@digia.com> | 2012-01-19 19:44:54 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-25 12:29:00 (GMT) |
commit | f149b7906cafc032aaff9d61a53079981a6ac497 (patch) | |
tree | c0b909a403ddb0804af7d7f8b4e620c443fce584 /src | |
parent | 3135b141bf11cd29d7503be0eb5190d351c2e7fd (diff) | |
download | Qt-f149b7906cafc032aaff9d61a53079981a6ac497.zip Qt-f149b7906cafc032aaff9d61a53079981a6ac497.tar.gz Qt-f149b7906cafc032aaff9d61a53079981a6ac497.tar.bz2 |
Fix set/paperSize(QPrinter::PaperSize) on Mac
This fixes the paper size setting on Mac as it would not return the
same paper size that was set with setPaperSize() when calling
paperSize().
Test is included.
Task-number: QTBUG-20882
Change-Id: Ib0064dd40de147d6db2424cdb31021e66894cc37
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/painting/qprintengine_mac.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qprintengine_mac.mm b/src/gui/painting/qprintengine_mac.mm index 729c87b..ecdba75 100644 --- a/src/gui/painting/qprintengine_mac.mm +++ b/src/gui/painting/qprintengine_mac.mm @@ -148,7 +148,7 @@ QMacPrintEnginePrivate::~QMacPrintEnginePrivate() void QMacPrintEnginePrivate::setPaperSize(QPrinter::PaperSize ps) { Q_Q(QMacPrintEngine); - QSizeF newSize = qt_paperSizeToQSizeF(ps); + QSize newSize = qt_paperSizeToQSizeF(ps).toSize(); QCFType<CFArrayRef> formats; PMPrinter printer; @@ -186,7 +186,7 @@ QPrinter::PaperSize QMacPrintEnginePrivate::paperSize() const int wMM = int((paper.right - paper.left) / 72 * 25.4 + 0.5); int hMM = int((paper.bottom - paper.top) / 72 * 25.4 + 0.5); for (int i = QPrinter::A4; i < QPrinter::NPaperSize; ++i) { - QSizeF s = qt_paperSizeToQSizeF(QPrinter::PaperSize(i)); + QSize s = qt_paperSizeToQSizeF(QPrinter::PaperSize(i)).toSize(); if (s.width() == wMM && s.height() == hMM) return (QPrinter::PaperSize)i; } |