From 74a51d590f4acd189f8d0594a5a706cbf97c805b Mon Sep 17 00:00:00 2001 From: John Layt Date: Mon, 17 Mar 2014 17:59:55 +0100 Subject: QPrinter - Fix DuplexMode on all platforms Add support to get/set the DuplexMode on Windows and Mac, improve the CUPS duplex handling, ensure support is the same on all platforms. [ChangeLog][QtPrintSupport][QPrinter] Added duplex support for Windows and OS X. Task-number: QTBUG-11332 Change-Id: I9d61d63233d828c3b1fd6df54072c6049f3c6298 Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/printsupport/kernel/qprinterinfo.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/printsupport/kernel/qprinterinfo.cpp') diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp index b1321bf57a..a17da3fdaa 100644 --- a/src/printsupport/kernel/qprinterinfo.cpp +++ b/src/printsupport/kernel/qprinterinfo.cpp @@ -352,6 +352,33 @@ QList QPrinterInfo::supportedResolutions() const return d->m_printDevice.supportedResolutions(); } +/*! + Returns the default duplex mode of this printer. + + \since 5.4 +*/ + +QPrinter::DuplexMode QPrinterInfo::defaultDuplexMode() const +{ + Q_D(const QPrinterInfo); + return QPrinter::DuplexMode(d->m_printDevice.defaultDuplexMode()); +} + +/*! + Returns a list of duplex modes supported by this printer. + + \since 5.4 +*/ + +QList QPrinterInfo::supportedDuplexModes() const +{ + Q_D(const QPrinterInfo); + QList list; + foreach (QPrint::DuplexMode mode, d->m_printDevice.supportedDuplexModes()) + list << QPrinter::DuplexMode(mode); + return list; +} + /*! Returns a list of all the available Printer Names on this system. -- cgit v1.2.3