diff --git a/src/gui/painting/qrasterbackingstore.cpp b/src/gui/painting/qrasterbackingstore.cpp index 49dbeae774..c1738ddcab 100644 --- a/src/gui/painting/qrasterbackingstore.cpp +++ b/src/gui/painting/qrasterbackingstore.cpp @@ -90,8 +90,8 @@ bool QRasterBackingStore::scroll(const QRegion ®ion, int dx, int dy) const qreal devicePixelRatio = m_image.devicePixelRatio(); const QPoint delta(dx * devicePixelRatio, dy * devicePixelRatio); - for (const QRect &rect : region) - qt_scrollRectInImage(m_image, QRect(rect.topLeft() * devicePixelRatio, rect.size() * devicePixelRatio), delta); + const QRect rect = region.boundingRect(); + qt_scrollRectInImage(m_image, QRect(rect.topLeft() * devicePixelRatio, rect.size() * devicePixelRatio), delta); return true; } diff --git a/src/plugins/platforms/offscreen/qoffscreencommon.cpp b/src/plugins/platforms/offscreen/qoffscreencommon.cpp index 76ebe79590..086b530e5f 100644 --- a/src/plugins/platforms/offscreen/qoffscreencommon.cpp +++ b/src/plugins/platforms/offscreen/qoffscreencommon.cpp @@ -197,8 +197,8 @@ bool QOffscreenBackingStore::scroll(const QRegion &area, int dx, int dy) if (m_image.isNull()) return false; - for (const QRect &rect : area) - qt_scrollRectInImage(m_image, rect, QPoint(dx, dy)); + const QRect rect = area.boundingRect(); + qt_scrollRectInImage(m_image, rect, QPoint(dx, dy)); return true; } diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp index e42237db13..3274c8548e 100644 --- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp +++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp @@ -182,8 +182,8 @@ bool QWindowsBackingStore::scroll(const QRegion &area, int dx, int dy) return false; const QPoint offset(dx, dy); - for (const QRect &rect : area) - qt_scrollRectInImage(m_image->image(), rect, offset); + const QRect rect = area.boundingRect(); + qt_scrollRectInImage(m_image->image(), rect, offset); return true; } diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index 1ea64f9f92..fda97ad2b0 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -488,8 +488,8 @@ bool QXcbBackingStoreImage::scroll(const QRegion &area, int dx, int dy) if (hasShm()) preparePaint(destinationRegion); - for (const QRect &rect : scrollArea) - qt_scrollRectInImage(m_qimage, rect, delta); + const QRect rect = scrollArea.boundingRect(); + qt_scrollRectInImage(m_qimage, rect, delta); } else { ensureGC(m_xcb_pixmap);