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(); p->restore();
} }
// fill with background color the unpainted area // fill the visible area around the page with the background color
const QVector<QRect> &backRects = remainingArea.rects(); for (const QRect& backRect : remainingArea )
int backRectsNumber = backRects.count(); p->fillRect( backRect, backColor );
for ( int jr = 0; jr < backRectsNumber; jr++ )
p->fillRect( backRects[ jr ], backColor );
} }
void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight ) void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight )

Loading…
Cancel
Save