qt5base-lts/tests/auto/widgets
Volker Hilsheimer ac80cee846 Don't crash when removing the last visible tab
The code incorrectly tried to ensure that the firstVisible tab was a
valid index, even though there might not be any visible tab left after
removing the last visible tab.

The same logic didn't exist of the lastVisible tab, so we tripped the
assert in qBound, as max (being -1) ended up smaller than min (0).

Fix this by removing the wrong correcting of firstVisible to be always
valid. Make sure we emit currentChanged with -1 when no visible tab is
left after removing the current tab.

Add a test.

Fixes: QTBUG-104003
Pick-to: 6.3 6.2
Change-Id: I27e6438a02d0a0f1ac4d0e0160cee4f33b3f3766
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-13 14:04:31 +02:00
..
dialogs Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
effects Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
graphicsview unblacklist passing tests 2022 2022-05-18 23:59:19 +02:00
itemviews Fix memory leak in tst_qtreewidget 2022-05-18 10:58:05 +00:00
kernel Fix separate delete of window and windowcontainer 2022-05-23 21:25:46 +02:00
styles Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
util Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
widgets Don't crash when removing the last visible tab 2022-06-13 14:04:31 +02:00
CMakeLists.txt Begin port of qtbase to CMake 2018-11-01 11:48:46 +00:00