Volker Hilsheimer ec16b18d82 QMdiArea: update indices list before potentially operating on it
When a subwindow before the current active window is removed, the
mapping of window index to index in the activated history needs to be
updated. This was done too late, so intermediate calls (e.g. to
update the layout of the area as a side-effect of calling
updateTabBarGeometry) operated on indices that were out of bounds,
leading to asserts.

Fix this bug by updating the index list as the first thing in
updateActiveWindow() which is always called when a window gets removed.
As a drive-by, make use of the fact that C++ knows about references,
instead of taking the address of the integer in the list.

Add a test case that asserts without the fix, and passes with it.

Fixes: QTBUG-129596
Pick-to: 6.5
Change-Id: I94d78dd49f486ee4aa6ffbddf528d985a206820d
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 665e1ea7a45d4f196958bf2b6d8f15c69d77340e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-22 13:15:24 +00:00
2024-02-29 15:35:57 +01:00
2024-10-19 06:50:22 +00:00
2024-07-12 01:42:29 +00:00
2024-09-19 07:20:47 +03:00
2024-02-02 15:23:02 +00:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%