diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-11-30 21:36:31 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-12-06 05:17:05 +0000 |
commit | 6fd1895900e9d6a4452e4156e432d163eed69d22 (patch) | |
tree | 0772bdf028ab2e0f078e3c7b9e328b94bc130cde | |
parent | 634344411e9a3204b6d20595ad94005ca6a393d2 (diff) |
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 <giuseppe.dangelo@kdab.com>
-rw-r--r-- | src/plugins/styles/windowsvista/qwindowsxpstyle.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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; } |