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>
This commit is contained in:
Lubomir I. Ivanov 2013-07-12 13:23:02 +03:00 committed by Dirk Hohndel
parent 63c33e152e
commit 2bfda14c0b

View file

@ -3,6 +3,7 @@
#include <QDesktopWidget> #include <QDesktopWidget>
#include <QApplication> #include <QApplication>
#include <QTextDocument> #include <QTextDocument>
#include <QAbstractTextDocumentLayout>
#include "mainwindow.h" #include "mainwindow.h"
#include "printlayout.h" #include "printlayout.h"
#include "../dive.h" #include "../dive.h"
@ -96,6 +97,7 @@ void PrintLayout::printTable() const
QSizeF pageSize; QSizeF pageSize;
pageSize.setWidth(pageRect.width()); pageSize.setWidth(pageRect.width());
pageSize.setHeight(pageRect.height()); pageSize.setHeight(pageRect.height());
doc.documentLayout()->setPaintDevice(printer);
doc.setPageSize(pageSize); doc.setPageSize(pageSize);
QString styleSheet( QString styleSheet(