summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gehad elrobey <gehadelrobey@gmail.com>2015-08-08 00:55:12 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2015-08-15 15:02:54 +0300
commit636c26feedb3abc1784747fac9b31aeb2fcee3bd (patch)
treebc537c6015b6ccde951aedea3a6843d792a3844e
parentdc56d1fa54e97d562a7b4df166faadf0b73e410c (diff)
downloadsubsurface-636c26feedb3abc1784747fac9b31aeb2fcee3bd.tar.gz
Printing: hide scrollbar from QWebview to fix padding issue
The vertical scrollbar was causing a default margin at the right most of the page which corrupted the page layout calculations. By hidding the vertical scrollbar the issue is fixed. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
-rw-r--r--printer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/printer.cpp b/printer.cpp
index eee0fdbd6..bce42c30d 100644
--- a/printer.cpp
+++ b/printer.cpp
@@ -149,6 +149,7 @@ void Printer::print()
pageSize.setHeight(printerPtr->pageRect(QPrinter::Inch).height() * dpi);
pageSize.setWidth(printerPtr->pageRect(QPrinter::Inch).width() * dpi);
webView->page()->setViewportSize(pageSize);
+ webView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
webView->setHtml(t.generate());
if (printOptions->color_selected && printerPtr->colorMode()) {
printerPtr->setColorMode(QPrinter::Color);