qt6-bb10/tests/auto/gui
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
..
image Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
itemmodels Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
kernel iOS: Always call setParent during QIOSWindow construction 2024-05-08 19:51:25 +02:00
math3d Change license for tests files 2024-02-04 09:56:42 +01:00
painting QRegion: re-add rects() and port setRects() to QSpan 2024-05-24 04:38:21 +00:00
platform Change license for tests files 2024-02-04 09:56:42 +01:00
qopengl Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglconfig Change license for tests files 2024-02-04 09:56:42 +01:00
qvulkan Revert "Android: SKIP cases failing on Android 12 CI with 16GB RAM" 2024-04-05 20:31:07 +00:00
rhi Revert "Skip Vulkan on Android in QRhi autotest" 2024-04-05 20:31:07 +00:00
text Support application fallbacks for common script 2024-05-21 07:24:03 +02:00
util QDesktopServices: clean up pre-Qt-6.6 code 2024-05-15 18:22:39 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00