Fix warning that QRegion::rects() is deprecated

Since we do need a container so we can sort, use std::back_inserter.

Change-Id: I6efb28c3145047559ec0fffd153880918eb47184
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Thiago Macieira 2018-06-15 18:43:56 -07:00
parent 6a89f89946
commit 150b9327a4
1 changed files with 2 additions and 1 deletions

View File

@ -796,7 +796,8 @@ QWidgetBackingStore::~QWidgetBackingStore()
static QVector<QRect> getSortedRectsToScroll(const QRegion &region, int dx, int dy)
{
QVector<QRect> rects = region.rects();
QVector<QRect> rects;
std::copy(region.begin(), region.end(), std::back_inserter(rects));
if (rects.count() > 1) {
std::sort(rects.begin(), rects.end(), [=](const QRect &r1, const QRect &r2) {
if (r1.y() == r2.y()) {