mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
Printing: use older Qt methods when calculating the ceil
Better portability for < Qt5.3. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
This commit is contained in:
parent
e86fd45efd
commit
67bfa9f968
1 changed files with 2 additions and 7 deletions
|
@ -194,13 +194,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
|
||||
#if QT_VERSION >= 0x050300
|
||||
pageSize.setHeight(printerPtr->pageLayout().paintRectPixels(dpi).height());
|
||||
pageSize.setWidth(printerPtr->pageLayout().paintRectPixels(dpi).width());
|
||||
#else
|
||||
pageSize.setHeight(printerPtr->pageRect(QPrinter::Inch).height() * dpi);
|
||||
pageSize.setWidth(printerPtr->pageRect(QPrinter::Inch).width() * dpi);
|
||||
#endif
|
||||
pageSize.setHeight(std::ceil(printerPtr->pageRect(QPrinter::Inch).height() * dpi));
|
||||
pageSize.setWidth(std::ceil(printerPtr->pageRect(QPrinter::Inch).width() * dpi));
|
||||
webView->page()->setViewportSize(pageSize);
|
||||
webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
|
||||
// export border width with at least 1 pixel
|
||||
|
|
Loading…
Reference in a new issue