From e2dcee55a38b86e48daad8a890ca2b4e6b122e37 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Wed, 5 Aug 2015 19:35:34 +0200 Subject: Printing: use pageRect() to support old QT versions While calculating the page size use QPrinter::pageRect instead of QPrinter::pageLayout which is added in QT 5.3 and is not supported in earlier versions. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Gehad elrobey --- printer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'printer.cpp') diff --git a/printer.cpp b/printer.cpp index fc18c9afe..2c1dcdc2f 100644 --- a/printer.cpp +++ b/printer.cpp @@ -144,8 +144,8 @@ void Printer::print() connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int))); dpi = printerPtr->resolution(); //rendering resolution = selected paper size in inchs * printer dpi - pageSize.setHeight(printerPtr->pageLayout().paintRect(QPageLayout::Inch).height() * dpi); - pageSize.setWidth(printerPtr->pageLayout().paintRect(QPageLayout::Inch).width() * dpi); + pageSize.setHeight(printerPtr->pageRect(QPrinter::Inch).height() * dpi); + pageSize.setWidth(printerPtr->pageRect(QPrinter::Inch).width() * dpi); webView->page()->setViewportSize(pageSize); webView->setHtml(t.generate()); if (printOptions->color_selected && printerPtr->colorMode()) { -- cgit v1.2.3-70-g09d2