diff options
author | Teemu Katajisto <teemu.katajisto@digia.com> | 2012-06-12 14:54:46 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-11 12:09:47 +0200 |
commit | 5d1d313ca7771f20e5359f2a0bfe4082043787e9 (patch) | |
tree | f38a54feea3c3bddf0e127c374d8b3fb9ad5e203 /src/printsupport/kernel/qprinter.cpp | |
parent | ce0c3c49b1dc5812c4e84d7a037695a53d764b7e (diff) |
QtPrintSupport: set QPrinter margins also to QPagedPaintDevice
QPagedPaintDevice::setMargins() is virtual method and reimplemented in
QPrinter but super class margins were not set in reimplemented method.
This fixes problem where QTextDocument::print() checked the margins
using QPagedPaintDevice::margins() and overrided the margins set
in QPrinter::setMargins().
Change-Id: I3bdcc33b8f6b5a9cbcb04a21484fdd1612dd7d58
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 06b121598b..2b4f1015ee 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -1584,6 +1584,9 @@ void QPrinter::setMargins(const Margins &m) { Q_D(QPrinter); + // set margins also to super class + QPagedPaintDevice::setMargins(m); + const qreal multiplier = 72./25.4; QList<QVariant> margins; margins << (m.left * multiplier) << (m.top * multiplier) |