From 44f7df439f729aff50f9d1b9dbba06391f151604 Mon Sep 17 00:00:00 2001 From: John Layt Date: Mon, 14 May 2012 21:02:13 +0100 Subject: QtPrintSupport - Add QPrinterInfo api for more printer details A previous commit changed the Mac behaviour for printerName() from returning the CUPS Description to returning the CUPS Name. In case anyone was relying on this for a human-readable name add new api to return the CUPS Description. Also add the Location and Make and Model which will be used in the Unix print dialog instead of directly calling CUPS. Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170 Reviewed-by: Teemu Katajisto Reviewed-by: Bradley T. Hughes Reviewed-by: Lars Knoll Reviewed-by: John Layt --- src/printsupport/kernel/qprinterinfo.cpp | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'src/printsupport/kernel/qprinterinfo.cpp') diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp index dc60d7a50f..5ce0165a15 100644 --- a/src/printsupport/kernel/qprinterinfo.cpp +++ b/src/printsupport/kernel/qprinterinfo.cpp @@ -137,6 +137,9 @@ QPrinterInfo &QPrinterInfo::operator=(const QPrinterInfo &other) /*! Returns the name of the printer. + This is a unique id to identify the printer and may not be human-readable. + + \sa QPrinterInfo::description() \sa QPrinter::setPrinterName() */ QString QPrinterInfo::printerName() const @@ -145,6 +148,44 @@ QString QPrinterInfo::printerName() const return d->name; } +/*! + \fn QString QPrinterInfo::description() + \since 5.0 + + Returns the human-readable description of the printer. + + \sa QPrinterInfo::printerName() +*/ +QString QPrinterInfo::description() const +{ + const Q_D(QPrinterInfo); + return d->description; +} + +/*! + \fn QString QPrinterInfo::location() + \since 5.0 + + Returns the human-readable location of the printer. +*/ +QString QPrinterInfo::location() const +{ + const Q_D(QPrinterInfo); + return d->location; +} + +/*! + \fn QString QPrinterInfo::makeAndModel() + \since 5.0 + + Returns the human-readable make and model of the printer. +*/ +QString QPrinterInfo::makeAndModel() const +{ + const Q_D(QPrinterInfo); + return d->makeAndModel; +} + /*! Returns whether this QPrinterInfo object holds a printer definition. -- cgit v1.2.3