Printing large pages fixed

This commit is contained in:
Arin Alexander 2018-03-15 22:58:08 +03:00
parent 1c379c568d
commit e5e2de70bf

View File

@ -291,10 +291,6 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
qreal leftMargin, topMargin, rightMargin, bottomMargin;
printer.getPageMargins(&leftMargin, &topMargin, &rightMargin, &bottomMargin, QPrinter::Millimeter);
QRectF printerPageRect = printer.pageRect(QPrinter::Millimeter);
printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR,
(printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR);
foreach(PageItemDesignIntf::Ptr page, pages){
if (
@ -344,6 +340,10 @@ void ReportEnginePrivate::printReport(ReportPages pages, QPrinter &printer)
painter = new QPainter(&printer);
}
QRectF printerPageRect = printer.pageRect(QPrinter::Millimeter);
printerPageRect = QRectF(0,0,(printerPageRect.size().width() + rightMargin + leftMargin) * Const::mmFACTOR,
(printerPageRect.size().height() + bottomMargin +topMargin) * Const::mmFACTOR);
if (printerPageRect.width() < page->geometry().width()){
qreal pageWidth = page->geometry().width();
QRectF currentPrintingRect = printerPageRect;