qt5base-lts/tests/auto
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
..
bic/data Add BiC data for the new way to do BiC testing 2022-05-12 13:33:41 +03:00
cmake Bump version to 6.5.0 2022-06-06 13:23:59 +03:00
concurrent QtConcurrent: prevent conversion of ReduceOption to initial value 2022-05-20 17:11:15 +02:00
corelib Windows: fix DeferredDelete events processing on QThread::terminate() 2022-06-10 19:40:32 +00:00
dbus QDBusArgument: ensure std::vector isn't seen as an associative container 2022-05-17 01:27:33 +02:00
gui Update window geometry when QWindow::m{in|ax}imumSize is updated 2022-06-13 09:19:17 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network QNetworkReply: Fix the test compilation 2022-06-10 20:57:19 +00:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
printsupport Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
shared Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
sql Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
testlib FatalSignalHandler: print the signal name on crash 2022-06-08 20:39:18 +00:00
tools Make uic generate correct C++ comments 2022-05-18 11:53:26 +02:00
widgets Don't crash when removing the last visible tab 2022-06-13 14:04:31 +02:00
xml Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
CMakeLists.txt Only configure one test for wasm 2022-05-12 18:55:04 +02:00
network-settings.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00