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>
This commit is contained in:
Teemu Katajisto 2012-06-12 14:54:46 +03:00 committed by Qt by Nokia
parent ce0c3c49b1
commit 5d1d313ca7

View File

@ -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)