aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/printlayout.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-12 13:23:02 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-07-18 12:00:12 -0700
commit2bfda14c0b39eb7594ee50b5511c51903845d983 (patch)
tree72edb8ce9a30426d7ce1d6a0b58d43276d970e20 /qt-ui/printlayout.cpp
parent63c33e152eab201f46c91e98e3fd4799996ea495 (diff)
downloadsubsurface-2bfda14c0b39eb7594ee50b5511c51903845d983.tar.gz
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 <neolit123@gmail.com>
Diffstat (limited to 'qt-ui/printlayout.cpp')
-rw-r--r--qt-ui/printlayout.cpp2
1 files changed, 2 insertions, 0 deletions
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 <QDesktopWidget>
#include <QApplication>
#include <QTextDocument>
+#include <QAbstractTextDocumentLayout>
#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(