qt6-bb10/tests/auto/widgets
Axel Spoerl f97e60a4f0 Fix crash in QMainWindow:.tabifiedDockWidgets()
QMainWindow:.tabifiedDockWidgets() was refactored in Qt 6.6.3, because
it returned wrong values. It now loops from 0 to
QMainWindowTabBar::count() and uses QMainWindowTabBar::dockAt(), to
get the dock widget pointer for an index.

When a dock widget is removed from a floating tab, event processing is
necessary for the item_list and QMainWindowTabBar::count() to get in
sync. This case was overlooked in the refactoring. It can lead to
dockAt() being called with an out-of-bounds index, which it asserted.
The assertion triggered, when QMainWindow::removeDockWidget() and
QMainWindow::tabifiedDockWidgets() were called right after each other,
without processing events inbetween.

QMainWindowTabBar::dockWidgets() doesn't add nullptr to the list, it
returns.

Therefore, return nullptr, when dockAt() is called out-of-bounds.
Add test functionality in
tst_QDockWidget::updateTabBarOnVisibilityChanged().

Fixes: QTBUG-124262
Pick-to: 6.7 6.5
Change-Id: If66084b9f00b4e39f7a620da68df67c735029cf1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-02 20:11:44 +00:00
..
dialogs tst_QFileDialog2::dontShowCompleterOnRoot() remove setActiveWindow() 2024-04-26 18:59:53 +02:00
effects Change license for tests files 2024-02-04 09:56:42 +01:00
graphicsview setFocus_complexTwoWidgets() remove setActiveWindow() 2024-05-02 12:47:09 +02:00
itemviews QTBUG14363_completerWithAnyKeyPressedEditTriggers remove setActiveWindo 2024-04-30 21:28:22 +02:00
kernel tst_QAction::disableShortcutsWithBlockedWidgets remove setActiveWindow 2024-04-30 18:30:16 +02:00
styles QTBUG36933_brokenPseudoClassLookup() remove setActiveWindow() 2024-04-26 18:19:38 +02:00
util QCompleter: Hide popup when widget is hidden 2024-04-30 16:30:16 +00:00
widgets Fix crash in QMainWindow:.tabifiedDockWidgets() 2024-05-02 20:11:44 +00:00
CMakeLists.txt