diff options
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index c1a2483f24..387101dc9b 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -1023,6 +1023,37 @@ QSizeF QPrinter::paperSize(Unit unit) const } /*! + \since 5.1 + + Sets the paper used by the printer to \a paperName. + + \sa paperName() +*/ + +void QPrinter::setPaperName(const QString &paperName) +{ + Q_D(QPrinter); + if (d->paintEngine->type() != QPaintEngine::Pdf) + ABORT_IF_ACTIVE("QPrinter::setPaperName"); + d->printEngine->setProperty(QPrintEngine::PPK_PaperName, paperName); + d->addToManualSetList(QPrintEngine::PPK_PaperName); +} + +/*! + \since 5.1 + + Returns the paper name of the paper set on the printer. + + The default value for this is driver-dependent. +*/ + +QString QPrinter::paperName() const +{ + Q_D(const QPrinter); + return d->printEngine->property(QPrintEngine::PPK_PaperName).toString(); +} + +/*! Sets the page order to \a pageOrder. The page order can be QPrinter::FirstPageFirst or @@ -1959,6 +1990,8 @@ QPrinter::PrintRange QPrinter::printRange() const \value PPK_PaperSources Specifies more than one QPrinter::PaperSource value. + \value PPK_PaperName A string specifying the name of the paper. + \value PPK_PaperSize Specifies a QPrinter::PaperSize value. \value PPK_PrinterName A string specifying the name of the printer. |