mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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>
This commit is contained in:
parent
11841563d2
commit
e2dcee55a3
1 changed files with 2 additions and 2 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue