summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJohn Layt <jlayt@kde.org>2014-01-28 15:05:17 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-17 13:46:13 +0100
commit1ffd79bfb7261268ea4b56d29122a48334a115a1 (patch)
tree122ab42a54d4c0d8db030690887d9a5bbcae8446 /src/plugins/platforms
parentdbc50e06df8465e6de02ac0b4458e1a3f3f8568c (diff)
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 <lars.knoll@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac.mm11
1 files changed, 6 insertions, 5 deletions
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);