mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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:
parent
63c33e152e
commit
2bfda14c0b
1 changed files with 2 additions and 0 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue