0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-20 06:30:03 +03:00
This commit is contained in:
Rodrigo Torres
2021-08-24 02:37:40 -03:00
parent 7dad9d700b
commit fa6cbef6a7
9 changed files with 56 additions and 3 deletions

View File

@@ -711,10 +711,18 @@ QSizeF PageItemDesignIntf::getRectByPageSize(const PageSize& size)
if (size != Custom) {
QPrinter printer;
printer.setOutputFormat(QPrinter::PdfFormat);
#if QT_VERSION < 0x060000
printer.setOrientation((QPrinter::Orientation)pageOrientation());
printer.setPaperSize((QPrinter::PageSize)size);
return QSizeF(printer.paperSize(QPrinter::Millimeter).width() * 10,
printer.paperSize(QPrinter::Millimeter).height() * 10);
#else
printer.setPageOrientation((QPageLayout::Orientation)pageOrientation());
printer.setPageSize(QPageSize((QPageSize::PageSizeId)size));
return QSizeF(printer.pageLayout().pageSize().size(QPageSize::Millimeter).width() * 10,
printer.pageLayout().pageSize().size(QPageSize::Millimeter).height() * 10);
#endif
}
else {