From 636c26feedb3abc1784747fac9b31aeb2fcee3bd Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Sat, 8 Aug 2015 00:55:12 +0200 Subject: 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 Signed-off-by: Gehad elrobey --- printer.cpp | 1 + 1 file changed, 1 insertion(+) 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); -- cgit v1.2.3-70-g09d2