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.
portage-wilder
Oliver Sander 7 years ago committed by Albert Astals Cid
parent 1918601611
commit f681fb0eb2
  1. 8
      ui/pageview.cpp

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

Loading…
Cancel
Save