From 2bfda14c0b39eb7594ee50b5511c51903845d983 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Fri, 12 Jul 2013 13:23:02 +0300 Subject: [PATCH] Print: support any resolution for the table print QTextDocument uses a separate painting device, thus we need to pass our QPrinter instance which may have a resolution different from the screen resolution. Signed-off-by: Lubomir I. Ivanov --- qt-ui/printlayout.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index 2184f7366..f0cbacaa9 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "mainwindow.h" #include "printlayout.h" #include "../dive.h" @@ -96,6 +97,7 @@ void PrintLayout::printTable() const QSizeF pageSize; pageSize.setWidth(pageRect.width()); pageSize.setHeight(pageRect.height()); + doc.documentLayout()->setPaintDevice(printer); doc.setPageSize(pageSize); QString styleSheet(