summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-05-07 13:49:27 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2009-05-07 15:41:34 (GMT)
commit90a65aa6611eb33229cdc00ffe6c22012944ba1a (patch)
tree3b5e940aff959c345e1071dc995b0af3c9651075 /src/gui/painting
parenta90daef6d4c3e0f0025c7c3ca4e4628c5776a389 (diff)
downloadQt-90a65aa6611eb33229cdc00ffe6c22012944ba1a.zip
Qt-90a65aa6611eb33229cdc00ffe6c22012944ba1a.tar.gz
Qt-90a65aa6611eb33229cdc00ffe6c22012944ba1a.tar.bz2
Fixed a problem that caused QPrintDialog to invalidate QPrinter.
When passing a printer that is set up to print to a PDF file into QPrintDialog, the print dialog could invalidate the printer and not update the validity of it in a proper manner. Task-number: 252873 Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qprinter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp
index 4f3e71c..6cecf2c 100644
--- a/src/gui/painting/qprinter.cpp
+++ b/src/gui/painting/qprinter.cpp
@@ -284,8 +284,8 @@ void QPrinterPrivate::addToManualSetList(QPrintEngine::PrintEnginePropertyKey ke
to send PostScript or PDF output to the printer. As an alternative,
the printProgram() function can be used to specify the command or utility
to use instead of the system default.
-
- Note that setting parameters like paper size and resolution on an
+
+ Note that setting parameters like paper size and resolution on an
invalid printer is undefined. You can use QPrinter::isValid() to
verify this before changing any parameters.
@@ -744,7 +744,7 @@ void QPrinter::setOutputFormat(OutputFormat format)
#ifndef QT_NO_PDF
Q_D(QPrinter);
- if (d->outputFormat == format)
+ if (d->validPrinter && d->outputFormat == format)
return;
d->outputFormat = format;
@@ -773,8 +773,8 @@ void QPrinter::setOutputFormat(OutputFormat format)
if (def_engine)
delete oldPrintEngine;
- d->validPrinter = d->outputFormat == QPrinter::PdfFormat || d->outputFormat == QPrinter::PostScriptFormat;
-
+ d->validPrinter = (d->outputFormat == QPrinter::PdfFormat
+ || d->outputFormat == QPrinter::PostScriptFormat);
#else
Q_UNUSED(format);
#endif