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:
parent
10f3c2bca6
commit
23401a1462
@ -673,18 +673,15 @@ void QMacPrintEngine::setProperty(PrintEnginePropertyKey key, const QVariant &va
|
|||||||
PMSetCopies(d->settings(), value.toInt(), false);
|
PMSetCopies(d->settings(), value.toInt(), false);
|
||||||
break;
|
break;
|
||||||
case PPK_Orientation: {
|
case PPK_Orientation: {
|
||||||
if (d->state == QPrinter::Active) {
|
QPrinter::Orientation newOrientation = QPrinter::Orientation(value.toInt());
|
||||||
qWarning("QMacPrintEngine::setOrientation: Orientation cannot be changed during a print job, ignoring change");
|
if (d->hasCustomPaperSize && (d->orient != newOrientation))
|
||||||
} else {
|
d->customSize = QSizeF(d->customSize.height(), d->customSize.width());
|
||||||
QPrinter::Orientation newOrientation = QPrinter::Orientation(value.toInt());
|
d->orient = newOrientation;
|
||||||
if (d->hasCustomPaperSize && (d->orient != newOrientation))
|
PMOrientation o = d->orient == QPrinter::Portrait ? kPMPortrait : kPMLandscape;
|
||||||
d->customSize = QSizeF(d->customSize.height(), d->customSize.width());
|
PMSetOrientation(d->format(), o, false);
|
||||||
d->orient = newOrientation;
|
PMSessionValidatePageFormat(d->session(), d->format(), kPMDontWantBoolean);
|
||||||
PMOrientation o = d->orient == QPrinter::Portrait ? kPMPortrait : kPMLandscape;
|
break;
|
||||||
PMSetOrientation(d->format(), o, false);
|
}
|
||||||
PMSessionValidatePageFormat(d->session(), d->format(), kPMDontWantBoolean);
|
|
||||||
}
|
|
||||||
break; }
|
|
||||||
case PPK_OutputFileName:
|
case PPK_OutputFileName:
|
||||||
d->outputFilename = value.toString();
|
d->outputFilename = value.toString();
|
||||||
break;
|
break;
|
||||||
|
@ -938,11 +938,9 @@ QPrinter::Orientation QPrinter::orientation() const
|
|||||||
The printer driver reads this setting and prints using the
|
The printer driver reads this setting and prints using the
|
||||||
specified orientation.
|
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().
|
take effect from the next call to newPage().
|
||||||
|
|
||||||
On Mac OS X, changing the orientation during a print job has no effect.
|
|
||||||
|
|
||||||
\sa orientation()
|
\sa orientation()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user