From 6fd1895900e9d6a4452e4156e432d163eed69d22 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 30 Nov 2017 21:36:31 +0100 Subject: styles: port away from QRegion::rects() Use begin()/end() instead. Drop the special handling of rectCount() == 1, since with begin()/end(), we no longer take the hit of creating a QVector just to be able to return it from rects(). Change-Id: I19ebc38267951c80bc71aa9d2b5df7403d710064 Reviewed-by: Giuseppe D'Angelo --- src/plugins/styles/windowsvista/qwindowsxpstyle.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/plugins/styles/windowsvista') diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp index ba993e55f2..22c91db7ca 100644 --- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp @@ -760,10 +760,8 @@ static QRegion scaleRegion(const QRegion ®ion, qreal factor) { if (region.isEmpty() || qFuzzyCompare(factor, qreal(1))) return region; - if (region.rectCount() == 1) - return QRegion(scaleRect(QRectF(region.boundingRect()), factor).toRect()); QRegion result; - foreach (const QRect &rect, region.rects()) + for (const QRect &rect : region) result += QRectF(QPointF(rect.topLeft()) * factor, QSizeF(rect.size() * factor)).toRect(); return result; } -- cgit v1.2.3