summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel/qprinter.cpp
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2014-01-20 17:59:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 13:46:04 +0100
commitab42391cd0b4cb0be03d0083f4e0d2b039a85a19 (patch)
tree871f8f394d1a31d1c8264bfa5ff8efc89702bd9f /src/printsupport/kernel/qprinter.cpp
parent4eb36ad5971240a9a934bef7be2c6297e092b797 (diff)
QPrintEngine - Switch Windows to QPlatformPrintDevice
Change the Windows QPrintEngine implementation to use the QPlatformPrintDevice to obtain device information, and use QPageSize to obtain page size conversions. A following change will use QPageLayout to store that page size. Change-Id: I990943e2b62ab6dab2c4d4a292c7ed7261beadf2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r--src/printsupport/kernel/qprinter.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 878dac60d5..9e10f5c636 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -151,15 +151,11 @@ Q_PRINTSUPPORT_EXPORT QSizeF qt_printerPaperSize(QPrinter::Orientation orientati
QPrinter::Unit unit,
int resolution)
{
- int width_index = 0;
- int height_index = 1;
- if (orientation == QPrinter::Landscape) {
- width_index = 1;
- height_index = 0;
- }
- const qreal multiplier = qt_multiplierForUnit(unit, resolution);
- return QSizeF((qt_paperSizes[paperSize][width_index] * 72 / 25.4) / multiplier,
- (qt_paperSizes[paperSize][height_index] * 72 / 25.4) / multiplier);
+ QPageSize pageSize = QPageSize(QPageSize::PageSizeId(paperSize));
+ if (orientation == QPrinter::Landscape)
+ return pageSize.size(QPage::Unit(unit), resolution).transposed();
+ else
+ return pageSize.size(QPage::Unit(unit), resolution);
}
QPrinterInfo QPrinterPrivate::findValidPrinter(const QPrinterInfo &printer)