diff --git a/src/platformsupport/fbconvenience/qfbbackingstore.cpp b/src/platformsupport/fbconvenience/qfbbackingstore.cpp index 2cad3441e4..e2d94406a4 100644 --- a/src/platformsupport/fbconvenience/qfbbackingstore.cpp +++ b/src/platformsupport/fbconvenience/qfbbackingstore.cpp @@ -104,9 +104,8 @@ void QFbBackingStore::beginPaint(const QRegion ®ion) if (mImage.hasAlphaChannel()) { QPainter p(&mImage); p.setCompositionMode(QPainter::CompositionMode_Source); - const QVector rects = region.rects(); - for (QVector::const_iterator it = rects.begin(); it != rects.end(); ++it) - p.fillRect(*it, Qt::transparent); + for (const QRect &r : region) + p.fillRect(r, Qt::transparent); } } diff --git a/src/platformsupport/fbconvenience/qfbscreen.cpp b/src/platformsupport/fbconvenience/qfbscreen.cpp index 2b4498157c..c42fd879f8 100644 --- a/src/platformsupport/fbconvenience/qfbscreen.cpp +++ b/src/platformsupport/fbconvenience/qfbscreen.cpp @@ -210,10 +210,9 @@ QRegion QFbScreen::doRedraw() if (!mPainter) mPainter = new QPainter(&mScreenImage); - const QVector rects = mRepaintRegion.rects(); const QRect screenRect = mGeometry.translated(-screenOffset); - for (int rectIndex = 0; rectIndex < mRepaintRegion.rectCount(); rectIndex++) { - const QRect rect = rects[rectIndex].intersected(screenRect); + for (QRect rect : mRepaintRegion) { + rect = rect.intersected(screenRect); if (rect.isEmpty()) continue; diff --git a/src/plugins/platforms/bsdfb/qbsdfbscreen.cpp b/src/plugins/platforms/bsdfb/qbsdfbscreen.cpp index 067a26a7b1..d752b539a0 100644 --- a/src/plugins/platforms/bsdfb/qbsdfbscreen.cpp +++ b/src/plugins/platforms/bsdfb/qbsdfbscreen.cpp @@ -247,8 +247,7 @@ QRegion QBsdFbScreen::doRedraw() if (!m_blitter) m_blitter.reset(new QPainter(&m_onscreenImage)); - const auto rects = touched.rects(); - for (const QRect &rect : rects) + for (const QRect &rect : touched) m_blitter->drawImage(rect, mScreenImage, rect); return touched; } diff --git a/src/plugins/platforms/integrity/qintegrityfbscreen.cpp b/src/plugins/platforms/integrity/qintegrityfbscreen.cpp index 3979937955..d64b96ca4c 100644 --- a/src/plugins/platforms/integrity/qintegrityfbscreen.cpp +++ b/src/plugins/platforms/integrity/qintegrityfbscreen.cpp @@ -204,15 +204,14 @@ QRegion QIntegrityFbScreen::doRedraw() if (!mBlitter) mBlitter = new QPainter(&mFbScreenImage); - QVector rects = touched.rects(); - for (int i = 0; i < rects.size(); i++) { + for (QRect rect : touched) { FBRect fbrect = { - (uint32_t)rects[i].left(), - (uint32_t)rects[i].top(), - (uint32_t)rects[i].width(), - (uint32_t)rects[i].height() + (uint32_t)rect.left(), + (uint32_t)rect.top(), + (uint32_t)rect.width(), + (uint32_t)rect.height() }; - mBlitter->drawImage(rects[i], mScreenImage, rects[i]); + mBlitter->drawImage(rect, mScreenImage, rect); gh_FB_expose(mFbh, &fbrect, NULL); } return touched; diff --git a/src/plugins/platforms/vnc/qvnc.cpp b/src/plugins/platforms/vnc/qvnc.cpp index fa65e8c9a4..44fc1c6101 100644 --- a/src/plugins/platforms/vnc/qvnc.cpp +++ b/src/plugins/platforms/vnc/qvnc.cpp @@ -476,7 +476,8 @@ void QRfbRawEncoder::write() // rgn &= QRect(0, 0, server->screen()->geometry().width(), // server->screen()->geometry().height()); // } - const QVector rects = rgn.rects(); + + const auto rectsInRegion = rgn.rectCount(); { const char tmp[2] = { 0, 0 }; // msg type, padding @@ -484,16 +485,16 @@ void QRfbRawEncoder::write() } { - const quint16 count = htons(rects.size()); + const quint16 count = htons(rectsInRegion); socket->write((char *)&count, sizeof(count)); } - if (rects.size() <= 0) + if (rectsInRegion <= 0) return; const QImage screenImage = client->server()->screenImage(); - for (const QRect &tileRect: rects) { + for (const QRect &tileRect: rgn) { const QRfbRect rect(tileRect.x(), tileRect.y(), tileRect.width(), tileRect.height()); rect.write(socket); diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp index 7731f6c806..5ff45ec183 100644 --- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp +++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp @@ -105,7 +105,7 @@ void qt_xcb_native_x11_info_init(QXcbConnection *conn) QVector qt_region_to_xrectangles(const QRegion &r) { const int numRects = r.rectCount(); - const QVector input = r.rects(); + const auto input = r.begin(); QVector output(numRects); for (int i = 0; i < numRects; ++i) { const QRect &in = input[i];