Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.12.4, 6.0, 6.3
-
None
Description
Pre 6.x settting printer's page orienation is easy:
QPrinter printer; printer.setPageOrientation (QPrinter::Landscape);
This member is removed in 6.x. Code should be replaced by
QPrinter printer(QPrinter::HighResolution); QPageLayout l (printer.pageLayout ()); // the margins of l are zero here, too small for the next statement: l.setOrientation (QPageLayout::Landscape); if (printer.setPageLayout (l)) qDebug () << "Landscape succeeded"; else qDebug () << "Landscape failed";
setPageLayout fails, for no explicit printer margins are given and
QPlatformPrintDevice::isValidPageLayout
checks the bounds for the margin during setPageLayout.
QPrinter::setFullPage, one can virtually print on the whole page.
Retrieving the minimal or sufficient printmargins for the printer, is done internally, but doesn't seem easily available by public members.
I don't understand why QPlatformPrintDevice::isValidPageLayout need to be checked here.