qt5base-lts/tests/auto/gui
Marc Mutz 77164e4cc0 QRegion: make iterable
Virtually all code in Qt that inspects a QRegion does
so by calling rects(), which returns a QVector<QRect>.

But rects() has a problem: A QRegion that contains just
one rectangle internally is not represented by a QVector,
and the mere act of calling rects() makes QRegion create
one.

So, expose the fact that QRegion is a container of QRects
to users by providing iterators and begin()/end(), which
can be nothrow, since for the one-rectangle case, instead
of vectorize()ing the region, we just return pointers to
(and one past) the 'extent' rectangle.

As a consequence, the iterator type is just const QRect*,
but I think that whatever containers QRegion may use under
the hood in the future, it will be certainly one that is
layout-compatible with a C array.

No mutable iterators are provided, since QRegion maintains
a running bounding-rect, so a mutable iterator would have
to call into QRegion for every change, which doesn't make
sense.

[ChangeLog][QtGui][QRegion] Is now iterable as a container
of QRects: added {c,}{r,}{begin,end}().

Change-Id: I2fa565fac0c1d26e2c0937604b23763cd4e23604
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-28 19:06:44 +00:00
..
image Merge remote-tracking branch 'origin/5.6' into 5.7 2016-02-18 20:50:35 +01:00
itemmodels QStandardItemModel: Reset the flags on clear() 2016-02-17 11:39:13 +00:00
kernel Merge remote-tracking branch 'origin/5.6' into 5.7 2016-02-24 13:31:14 +01:00
math3d Updated license headers 2016-01-21 18:55:18 +00:00
painting QRegion: make iterable 2016-02-28 19:06:44 +00:00
qopengl Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev 2016-01-26 11:27:37 +00:00
qopenglconfig Updated license headers 2016-01-21 18:55:18 +00:00
text Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev 2016-02-25 12:23:23 +00:00
util Updated license headers 2016-01-21 18:55:18 +00:00
gui.pro Add qopenglconfig test. 2015-02-02 23:05:41 +00:00