path: root/src/printsupport/kernel/qcups.cpp
diff options
authorMartin Klapetek <>2013-09-18 16:22:48 +0200
committerThe Qt Project <>2013-09-20 00:50:04 +0200
commit00e50fb97c3d9b91193fef50d63b430e4648ac52 (patch)
tree5e4753cf8d8b7d3c2f5f54600f5d1ce6013f511a /src/printsupport/kernel/qcups.cpp
parent438912f27350cfe5f63f8abc68f4fc99614ee7c5 (diff)
Expose more CUPS options via the 'Properties' dialog
On systems with CUPS support users can now choose how many pages from a document are to be printed on paper. This can vary from 1 page per document to 16 pages per document. The page preview changes upon the users selection. Also included in the patch is an option to choose the flow for text. Users can now print documents in the "Right to Left" order or "Bottom to Top", including many other options. [ChangeLog][QtPrintSupport][QPrintDialog] Added support for setting CUPS Pages Per Sheet and Pages Per Sheet Layout options Change-Id: I4e60a4523c6e06d4c15fe9ee9590248fa7ae2038 Reviewed-by: John Layt <>
Diffstat (limited to 'src/printsupport/kernel/qcups.cpp')
1 files changed, 11 insertions, 0 deletions
diff --git a/src/printsupport/kernel/qcups.cpp b/src/printsupport/kernel/qcups.cpp
index a10baaa7fb..7c426d4d36 100644
--- a/src/printsupport/kernel/qcups.cpp
+++ b/src/printsupport/kernel/qcups.cpp
@@ -511,6 +511,17 @@ void QCUPSSupport::setPageSet(QPrinter *printer, const PageSet pageSet)
setCupsOptions(printer, cupsOptions);
+void QCUPSSupport::setPagesPerSheetLayout(QPrinter *printer, const PagesPerSheet pagesPerSheet,
+ const PagesPerSheetLayout pagesPerSheetLayout)
+ QStringList cupsOptions = cupsOptionsList(printer);
+ static const char *pagesPerSheetData[] = { "1", "2", "4", "6", "9", "16", 0 };
+ static const char *pageLayoutData[] = {"lrtb", "lrbt", "rlbt", "rltb", "btlr", "btrl", "tblr", "tbrl", 0};
+ setCupsOption(cupsOptions, QStringLiteral("number-up"), pagesPerSheetData[pagesPerSheet]);
+ setCupsOption(cupsOptions, QStringLiteral("number-up-layout"), pageLayoutData[pagesPerSheetLayout]);
+ setCupsOptions(printer, cupsOptions);
bool QCUPSSupport::printerHasPPD(const char *printerName)
if (!isAvailable())