Commit d8e38131 authored by Anatoly Stolbov's avatar Anatoly Stolbov

TextEditor: printPage: add const to variables

Change-Id: I38959eb95b5d37d7e4936a5644af33b645e8da9f
Reviewed-by: default avatarDavid Schulz <david.schulz@theqtcompany.com>
parent b57a35ab
......@@ -794,17 +794,17 @@ static void printPage(int index, QPainter *painter, const QTextDocument *doc,
painter->save();
painter->translate(body.left(), body.top() - (index - 1) * body.height());
QRectF view(0, (index - 1) * body.height(), body.width(), body.height());
const QRectF view(0, (index - 1) * body.height(), body.width(), body.height());
QAbstractTextDocumentLayout *layout = doc->documentLayout();
QAbstractTextDocumentLayout::PaintContext ctx;
painter->setFont(QFont(doc->defaultFont()));
QRectF box = titleBox.translated(0, view.top());
int dpix = painter->device()->logicalDpiX();
int dpiy = painter->device()->logicalDpiY();
int mx = 5 * dpix / 72.0;
int my = 2 * dpiy / 72.0;
const QRectF box = titleBox.translated(0, view.top());
const int dpix = painter->device()->logicalDpiX();
const int dpiy = painter->device()->logicalDpiY();
const int mx = 5 * dpix / 72.0;
const int my = 2 * dpiy / 72.0;
painter->fillRect(box.adjusted(-mx, -my, mx, my), QColor(210, 210, 210));
if (!title.isEmpty())
painter->drawText(box, Qt::AlignCenter, title);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment