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