From 1ffd79bfb7261268ea4b56d29122a48334a115a1 Mon Sep 17 00:00:00 2001 From: John Layt Date: Tue, 28 Jan 2014 15:05:17 +0100 Subject: QPrinter - Fix winPageSize() on Mac and Linux Using QPageSize internally provides the Windows ID on all platforms so remove the conditional compile on the QPrinter api and add support to the print engines. Change-Id: I31e23d5090a9b6ceb087c29dead050b0ee1855a5 Reviewed-by: Lars Knoll --- src/plugins/platforms/cocoa/qprintengine_mac.mm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/cocoa/qprintengine_mac.mm') diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index 95713eba59..fb968f31e9 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -472,8 +472,6 @@ void QMacPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va break; case PPK_SelectionOption: break; - case PPK_WindowsPageSize: - break; // The following keys are properties and settings that are supported by the Mac PrintEngine case PPK_Resolution: { @@ -535,6 +533,9 @@ void QMacPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va // Get the named page size from the printer if supported d->setPageSize(d->m_printDevice->supportedPageSize(value.toString())); break; + case PPK_WindowsPageSize: + d->setPageSize(QPageSize(QPageSize::id(value.toInt()))); + break; case PPK_PrinterName: { QString id = value.toString(); if (id.isEmpty()) @@ -629,9 +630,6 @@ QVariant QMacPrintEngine::property(PrintEnginePropertyKey key) const case PPK_SelectionOption: ret = QString(); break; - case PPK_WindowsPageSize: - // Special case, leave null - break; // The following keys are properties and settings that are supported by the Mac PrintEngine case PPK_CollateCopies: { @@ -680,6 +678,9 @@ QVariant QMacPrintEngine::property(PrintEnginePropertyKey key) const case PPK_PaperName: ret = d->m_pageLayout.pageSize().name(); break; + case PPK_WindowsPageSize: + ret = d->m_pageLayout.pageSize().windowsId(); + break; case PPK_PaperRect: // PaperRect is returned in device pixels ret = d->m_pageLayout.fullRectPixels(d->resolution.hRes); -- cgit v1.2.3