aboutsummaryrefslogtreecommitdiffstats
path: root/printer.cpp
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-08-05 19:35:34 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-08-15 15:02:17 +0300
commite2dcee55a38b86e48daad8a890ca2b4e6b122e37 (patch)
tree7a56cfce08908ffa864cc9f28f15fce362cdcb88 /printer.cpp
parent11841563d25a18bee5fc5e52139ca3d89d601818 (diff)
downloadsubsurface-e2dcee55a38b86e48daad8a890ca2b4e6b122e37.tar.gz
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 <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Diffstat (limited to 'printer.cpp')
-rw-r--r--printer.cpp4
1 files changed, 2 insertions, 2 deletions
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()) {