From 5af95d077bc7bcb1633d81686d324d167746040b Mon Sep 17 00:00:00 2001 From: John Layt Date: Fri, 17 Jan 2014 16:45:18 +0100 Subject: QPrinter - Fix Printer Selection option on Windows Make the printer selection option api public on Windows to be consistent with Mac, and with the print program api which is already public. Change-Id: I3da9684288348eaa43276ca8534a1d5809f7027b Reviewed-by: Lars Knoll --- src/printsupport/kernel/qprinter.cpp | 22 ++++++++++------------ src/printsupport/kernel/qprinter.h | 2 -- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'src/printsupport/kernel') diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 77fa40f414..366e3bc844 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -1828,11 +1828,17 @@ QList QPrinter::supportedPaperSources() const Any other value implies that the given value should be used. - \warning This function is not available on Windows. + This function always returns an empty string on Windows and Mac. - \sa setPrinterSelectionOption() + \sa setPrinterSelectionOption(), setPrintProgram() */ +QString QPrinter::printerSelectionOption() const +{ + Q_D(const QPrinter); + return d->printEngine->property(QPrintEngine::PPK_SelectionOption).toString(); +} + /*! \fn void QPrinter::setPrinterSelectionOption(const QString &option) @@ -1844,24 +1850,16 @@ QList QPrinter::supportedPaperSources() const If the printer selection option is changed while the printer is active, the current print job may or may not be affected. - \warning This function is not available on Windows. + This function has no effect on Windows or Mac. - \sa printerSelectionOption() + \sa printerSelectionOption(), setPrintProgram() */ -#ifndef Q_OS_WIN -QString QPrinter::printerSelectionOption() const -{ - Q_D(const QPrinter); - return d->printEngine->property(QPrintEngine::PPK_SelectionOption).toString(); -} - void QPrinter::setPrinterSelectionOption(const QString &option) { Q_D(QPrinter); d->setProperty(QPrintEngine::PPK_SelectionOption, option); } -#endif /*! \since 4.1 diff --git a/src/printsupport/kernel/qprinter.h b/src/printsupport/kernel/qprinter.h index d529c06b4d..54047c0c32 100644 --- a/src/printsupport/kernel/qprinter.h +++ b/src/printsupport/kernel/qprinter.h @@ -227,10 +227,8 @@ public: QRectF paperRect(Unit) const; QRectF pageRect(Unit) const; -#if !defined(Q_OS_WIN) || defined(Q_QDOC) QString printerSelectionOption() const; void setPrinterSelectionOption(const QString &); -#endif bool newPage(); bool abort(); -- cgit v1.2.3