qt6-bb10/tests/auto/gui/painting
Marc Mutz 0076999031 QRegion: re-add rects() and port setRects() to QSpan
In Qt 5, we had QVector<QRect> QRegion::rects(), but it was
deprecated, because just iterating over the QRegion as a container of
QRects was more efficient (QRegion has a SSO for the case of one
rectangle). With QSpan, we can now bring it back with the same
efficiency as iteration, supporting Qt 5 code that never made the move
away from rects() and new code that wishes to make the conversion into
rectangles more explicit. Re-add the Qt 5 tests, which show that the
function is nearly a drop-in replacement for the Qt 5 rects() (QSpan,
at the time of this commit, doesn't have relational operators, yet).

Also add a QSpan overload of setRects(). The old (ptr, n) function
(now obsoleted, but not deprecated) allowed nullptr + n != 0, which
QSpan doesn't accept, so print a warning in that case. Also, QSpan can
hold more than INT_MAX elements on 64-bit platforms, but QRegion's API
was never ported from int to qsizetype, so we need to catch oversized
spans used as inputs, too.

[ChangeLog][QtGui][QRegion] Added QSpan overload of setRects();
re-added Qt5's rects(), but returning QSpan instead of QVector now.

Fixes: QTBUG-124712
Change-Id: I24570c886cbf77abd8d1f4a3f42ae53c892cd9ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-24 04:38:21 +00:00
..
qbrush Change license for tests files 2024-02-04 09:56:42 +01:00
qcolor Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qcolorspace Use QCOMPARE_GE/QCOMPARE_LE 2024-04-19 21:09:14 +02:00
qcolortransform Fix build with gcc-14 2024-02-14 00:25:55 +00:00
qpagelayout print: Clamp margins entered by the user in the page setup dialog 2024-04-25 14:22:30 +03:00
qpageranges Change license for tests files 2024-02-04 09:56:42 +01:00
qpagesize Change license for tests files 2024-02-04 09:56:42 +01:00
qpaintengine Change license for tests files 2024-02-04 09:56:42 +01:00
qpainter Port QImage::Format_CMYK32 to CMYK8888 2024-04-04 16:08:22 +01:00
qpainterpath QPainterPath: detach and reset before streaming in 2024-02-27 03:47:11 +01:00
qpainterpathstroker Change license for tests files 2024-02-04 09:56:42 +01:00
qpathclipper Remove extra semi-colons 2024-02-06 20:17:18 +09:00
qpdfwriter Change license for tests files 2024-02-04 09:56:42 +01:00
qpen Change license for tests files 2024-02-04 09:56:42 +01:00
qpolygon Change license for tests files 2024-02-04 09:56:42 +01:00
qregion QRegion: re-add rects() and port setRects() to QSpan 2024-05-24 04:38:21 +00:00
qtransform Change license for tests files 2024-02-04 09:56:42 +01:00
qwmatrix Get rid of QMatrix 2020-02-28 08:57:57 +01:00
CMakeLists.txt Fix build without PDF 2024-02-25 21:40:47 +00:00