diff options
author | Andy Shaw <andy.shaw@digia.com> | 2013-01-01 01:33:42 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-11 17:50:56 +0100 |
commit | 83e6d1fe6006ad8e3cf37d5ca412aedae5aab9a4 (patch) | |
tree | 3d0bce6a62c444f4655292084530c9cfe1561f76 /src/printsupport/kernel/qprinterinfo.cpp | |
parent | 78d4c949a4556255303cb3fc2ce0d91900167f43 (diff) |
Add support for getting the paper names available for the printer
Task-number: QTBUG-27714
Change-Id: I9bc6f1188f262e43f581add058d7895e1b5bd9e3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/printsupport/kernel/qprinterinfo.cpp')
-rw-r--r-- | src/printsupport/kernel/qprinterinfo.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp index 32ed4fa5af..f863b23e34 100644 --- a/src/printsupport/kernel/qprinterinfo.cpp +++ b/src/printsupport/kernel/qprinterinfo.cpp @@ -222,6 +222,25 @@ QList<QPrinter::PaperSize> QPrinterInfo::supportedPaperSizes() const return d->paperSizes; } +/*! + Returns a list of all the paper names supported by the driver with the + corresponding size in millimeters. + + Not all printer drivers support this query, so the list may be empty. + + \since 5.1 +*/ + +QList<QPair<QString, QSizeF> > QPrinterInfo::supportedSizesWithNames() const +{ + Q_D(const QPrinterInfo); + if (!isNull() && !d->hasPaperNames) { + d->paperNames = QPlatformPrinterSupportPlugin::get()->supportedSizesWithNames(*this); + d->hasPaperNames = true; + } + return d->paperNames; +} + QList<QPrinterInfo> QPrinterInfo::availablePrinters() { QPlatformPrinterSupport *ps = QPlatformPrinterSupportPlugin::get(); |