Commit f681fb0e authored by Oliver Sander's avatar Oliver Sander Committed by Albert Astals Cid

Use range-based for to iterate over a QRegion

According to

  https://doc.qt.io/qt-5/qregion-obsolete.html#rects

the method QRegion::rects is obsolete and should be avoided.
Let's do that by moving to a range-based for over the QRegion.
That is easier to read anyway.
parent 19186016
......@@ -3571,11 +3571,9 @@ void PageView::drawDocumentOnPainter( const QRect & contentsRect, QPainter * p )
p->restore();
}
// fill with background color the unpainted area
const QVector<QRect> &backRects = remainingArea.rects();
int backRectsNumber = backRects.count();
for ( int jr = 0; jr < backRectsNumber; jr++ )
p->fillRect( backRects[ jr ], backColor );
// fill the visible area around the page with the background color
for (const QRect& backRect : remainingArea )
p->fillRect( backRect, backColor );
}
void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight )
......
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