QPrinter - Enable changing of Orientation on Mac

Since OSX 10.4 it has been possible to change the page orientation
during a print job.

Task-number: QTBUG-27630

Change-Id: Ic3c69e83afebbb9267ef6f435f968aeef2b72963
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
John Layt 2014-01-23 14:44:45 +01:00 committed by The Qt Project
parent 10f3c2bca6
commit 23401a1462
2 changed files with 10 additions and 15 deletions

View File

@ -673,18 +673,15 @@ void QMacPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
PMSetCopies(d->settings(), value.toInt(), false);
break;
case PPK_Orientation: {
if (d->state == QPrinter::Active) {
qWarning("QMacPrintEngine::setOrientation: Orientation cannot be changed during a print job, ignoring change");
} else {
QPrinter::Orientation newOrientation = QPrinter::Orientation(value.toInt());
if (d->hasCustomPaperSize && (d->orient != newOrientation))
d->customSize = QSizeF(d->customSize.height(), d->customSize.width());
d->orient = newOrientation;
PMOrientation o = d->orient == QPrinter::Portrait ? kPMPortrait : kPMLandscape;
PMSetOrientation(d->format(), o, false);
PMSessionValidatePageFormat(d->session(), d->format(), kPMDontWantBoolean);
}
break; }
QPrinter::Orientation newOrientation = QPrinter::Orientation(value.toInt());
if (d->hasCustomPaperSize && (d->orient != newOrientation))
d->customSize = QSizeF(d->customSize.height(), d->customSize.width());
d->orient = newOrientation;
PMOrientation o = d->orient == QPrinter::Portrait ? kPMPortrait : kPMLandscape;
PMSetOrientation(d->format(), o, false);
PMSessionValidatePageFormat(d->session(), d->format(), kPMDontWantBoolean);
break;
}
case PPK_OutputFileName:
d->outputFilename = value.toString();
break;

View File

@ -938,11 +938,9 @@ QPrinter::Orientation QPrinter::orientation() const
The printer driver reads this setting and prints using the
specified orientation.
On Windows, this option can be changed while printing and will
On Windows and Mac, this option can be changed while printing and will
take effect from the next call to newPage().
On Mac OS X, changing the orientation during a print job has no effect.
\sa orientation()
*/