summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorJohn Layt <john@layt.net>2010-02-16 01:13:13 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-03-04 14:21:03 (GMT)
commit4984b36c73fb59006a28051ea82bdca0b7aeb457 (patch)
treed4ef8c6f08866bd73c532ef20ae08a0a946b08bd /src/gui/painting
parentc5264c89b7710dc2f2d8c7c604f0b23852cb2eef (diff)
downloadQt-4984b36c73fb59006a28051ea82bdca0b7aeb457.zip
Qt-4984b36c73fb59006a28051ea82bdca0b7aeb457.tar.gz
Qt-4984b36c73fb59006a28051ea82bdca0b7aeb457.tar.bz2
QPrinter: Add Current Page print range support
Support the selection of Current Page option in the print dialog by activating a new QPrintDialog::PrintDialogOption. If selected the PrintRange is set to CurrentPage. It is the responsibility of the application to read the PrintRange and apply the Current Page selection when rendering the pages. Merge-request: 2311 Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qprinter.cpp3
-rw-r--r--src/gui/painting/qprinter.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index edf224d..ae21416 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -382,6 +382,7 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
\value AllPages All pages should be printed.
\value Selection Only the selection should be printed.
\value PageRange The specified page range should be printed.
+ \value CurrentPage Only the current page should be printed.
\sa QAbstractPrintDialog::PrintRange
*/
@@ -571,6 +572,7 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
\value AllPages All the pages should be printed.
\value Selection Only the selection should be printed.
\value PageRange Print according to the from page and to page options.
+ \value CurrentPage Only the current page should be printed.
\sa setPrintRange(), printRange()
*/
@@ -586,6 +588,7 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
\value PrintSelection Describes if printing selections should be enabled.
\value PrintPageRange Describes if printing page ranges (from, to) should
be enabled
+ \value PrintCurrentPage if Print Current Page option should be enabled
\sa setOptionEnabled(), isOptionEnabled()
*/
diff --git a/src/gui/painting/qprinter.h b/src/gui/painting/qprinter.h
index 6636179..996a954 100644
--- a/src/gui/painting/qprinter.h
+++ b/src/gui/painting/qprinter.h
@@ -124,7 +124,7 @@ public:
enum OutputFormat { NativeFormat, PdfFormat, PostScriptFormat };
// ### Qt 5: Merge with QAbstractPrintDialog::PrintRange
- enum PrintRange { AllPages, Selection, PageRange };
+ enum PrintRange { AllPages, Selection, PageRange, CurrentPage };
enum Unit {
Millimeter,