From 5d1d313ca7771f20e5359f2a0bfe4082043787e9 Mon Sep 17 00:00:00 2001 From: Teemu Katajisto Date: Tue, 12 Jun 2012 14:54:46 +0300 Subject: 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 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/printsupport/kernel/qprinter.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/printsupport') 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 margins; margins << (m.left * multiplier) << (m.top * multiplier) -- cgit v1.2.3