diff options
author | Peng Wenhao <pengwenhao@uniontech.com> | 2020-08-27 14:21:07 +0800 |
---|---|---|
committer | Peng Wenhao <pengwenhao@uniontech.com> | 2020-09-01 04:57:48 +0800 |
commit | f0ae973244026ca5382f05630bd799b44154d224 (patch) | |
tree | 630eef965e2fe07745c41fffdfa00b30c3ce2485 /src/gui/text | |
parent | 90358f6042d1fe2db849e17e1b0c875fb0560b20 (diff) |
Qpagedpaintdevice: Use marginsF instead of internal struct margins
resolve remaining Qt6 TODOs
Change-Id: Iad659a09ddfe136bdc545bc0635b4c695540c58b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 3cee66095b..877bae0f0a 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -1918,9 +1918,12 @@ void QTextDocument::print(QPagedPaintDevice *printer) const QPagedPaintDevicePrivate *pd = QPagedPaintDevicePrivate::get(printer); // ### set page size to paginated size? - QPagedPaintDevice::Margins m = printer->margins(); - if (!documentPaginated && m.left == 0. && m.right == 0. && m.top == 0. && m.bottom == 0.) { - m.left = m.right = m.top = m.bottom = 2.; + QMarginsF m = printer->margins(); + if (!documentPaginated && m.left() == 0. && m.right() == 0. && m.top() == 0. && m.bottom() == 0.) { + m.setLeft(2); + m.setRight(2); + m.setTop(2); + m.setBottom(2); printer->setMargins(m); } // ### use the margins correctly |