QtTestLib: port away from QRegion::rects()

Use begin()/rectCount() instead.

Change-Id: I08cef424bf24ecf3c058e9b87411f2a5775ffb33
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Marc Mutz 2017-11-30 21:37:49 +01:00
parent 8c8459258f
commit 784ed9b4f7

View File

@ -91,8 +91,8 @@ template<> inline char *toString(const QRegion &region)
} else if (region.isEmpty()) { } else if (region.isEmpty()) {
result += "empty"; result += "empty";
} else { } else {
const QVector<QRect> &rects = region.rects(); const auto rects = region.begin();
const int rectCount = rects.size(); const int rectCount = region.rectCount();
if (rectCount > 1) { if (rectCount > 1) {
result += QByteArray::number(rectCount); result += QByteArray::number(rectCount);
result += " rectangles, "; result += " rectangles, ";
@ -100,7 +100,7 @@ template<> inline char *toString(const QRegion &region)
for (int i = 0; i < rectCount; ++i) { for (int i = 0; i < rectCount; ++i) {
if (i) if (i)
result += ", "; result += ", ";
const QRect &r = rects.at(i); const QRect &r = rects[i];
result += QByteArray::number(r.width()); result += QByteArray::number(r.width());
result += 'x'; result += 'x';
result += QByteArray::number(r.height()); result += QByteArray::number(r.height());