summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel/qprintengine_pdf.cpp
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/printsupport/kernel/qprintengine_pdf.cpp
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/printsupport/kernel/qprintengine_pdf.cpp')
-rw-r--r--src/printsupport/kernel/qprintengine_pdf.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/printsupport/kernel/qprintengine_pdf.cpp b/src/printsupport/kernel/qprintengine_pdf.cpp
index d62da0e1d6..a2ab68a96d 100644
--- a/src/printsupport/kernel/qprintengine_pdf.cpp
+++ b/src/printsupport/kernel/qprintengine_pdf.cpp
@@ -136,8 +136,6 @@ void QPdfPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
// The following keys are settings that are unsupported by the PDF PrintEngine
case PPK_CustomBase:
break;
- case PPK_WindowsPageSize:
- break;
// The following keys are properties and settings that are supported by the PDF PrintEngine
case PPK_CollateCopies:
@@ -188,6 +186,9 @@ void QPdfPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
}
break;
}
+ case PPK_WindowsPageSize:
+ d->m_pageLayout.setPageSize(QPageSize(QPageSize::id(value.toInt())));
+ break;
case PPK_PaperSource:
d->paperSource = QPrinter::PaperSource(value.toInt());
break;
@@ -254,9 +255,6 @@ QVariant QPdfPrintEngine::property(PrintEnginePropertyKey key) const
case PPK_CustomBase:
// Special case, leave null
break;
- case PPK_WindowsPageSize:
- // Special case, leave null
- break;
// The following keys are properties and settings that are supported by the PDF PrintEngine
case PPK_CollateCopies:
@@ -298,6 +296,9 @@ QVariant QPdfPrintEngine::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_PaperSource:
ret = d->paperSource;
break;