diff options
author | John Layt <jlayt@kde.org> | 2013-12-18 21:51:12 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-17 13:45:44 +0100 |
commit | b0428926cece7bc362bc24c2eb1621b9fef737c7 (patch) | |
tree | e5497f1b5c2f7bdacb5e7e0ba9898f9423884e26 /src/plugins/platforms/cocoa/qprintengine_mac.mm | |
parent | cf8b8340f3d283830a6aca2f708e839bb70d6d57 (diff) |
QPrinterInfo - Switch to QPlatformPrintDevice
Change the QPrinterInfo implementation to use QPlatformPrintDevice as
the backend. Remove all the old QPrinterInfo related code from the
QPA plugin. Add public api to QPrinterInfo to support some features
from QPlatformPrintDevice.
[ChangeLog][QtPrintSupport][QPrinterInfo] Added new public api for
isRemote(), state(), defaultPageSize(), supportedPageSizes(),
supportsCustomPageSizes(), minimumPhysicalPageSize(),
maximumPhysicalPageSize(), supportedResolutions(),
availablePrinterNames(), and defaultPrinterName(). The use of
availablePrinters() is discouraged due to performance concerns.
Task-number: QTBUG-35248
Change-Id: Ic38323a930549ad67bf04a1a6bb43d623dfe6a33
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qprintengine_mac.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qprintengine_mac.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac.mm b/src/plugins/platforms/cocoa/qprintengine_mac.mm index 3e92a45a62..f34fadd8a1 100644 --- a/src/plugins/platforms/cocoa/qprintengine_mac.mm +++ b/src/plugins/platforms/cocoa/qprintengine_mac.mm @@ -41,6 +41,7 @@ #include "qprintengine_mac_p.h" #include <quuid.h> +#include <QtGui/qpagesize.h> #include <QtCore/qcoreapplication.h> #include <qpa/qplatformprintersupport.h> @@ -148,7 +149,7 @@ void QMacPrintEnginePrivate::setPaperSize(QPrinter::PaperSize ps) PMPrinter printer; if (PMSessionGetCurrentPrinter(session(), &printer) == noErr) { if (ps != QPrinter::Custom) { - QSizeF newSize = QPlatformPrinterSupport::convertPaperSizeToQSizeF(ps); + QSizeF newSize = QPageSize(QPageSize::PageSizeId(ps)).size(QPageSize::Millimeter); QCFType<CFArrayRef> formats; if (PMSessionCreatePageFormatList(session(), printer, &formats) == noErr) { CFIndex total = CFArrayGetCount(formats); @@ -197,7 +198,7 @@ QPrinter::PaperSize QMacPrintEnginePrivate::paperSize() const PMRect paper; PMGetUnadjustedPaperRect(format(), &paper); QSizeF sizef((paper.right - paper.left) / 72.0 * 25.4, (paper.bottom - paper.top) / 72.0 * 25.4); - return QPlatformPrinterSupport::convertQSizeFToPaperSize(sizef); + return QPrinter::PaperSize(QPageSize(sizef, QPageSize::Millimeter).id()); } void QMacPrintEnginePrivate::setPaperName(const QString &name) |