# QDockWidget docking bug reproducer

This is a project that illustrates two closely related bugs in the docking and undocking of QDockWidgets.

## Environment

* macOS
* Qt Creator downloaded from the official sources
* Qt 6.6.0

## Issue 1 - Undocking tabbed widget from floating window creates an empty redundant floating window

1.      Launch the sample application. A main window with two docked group widgets will show.
2.      Undock the tabbed dock widget group outside the main window to its own floating window.
3.      Undock one of the tabbed widgets from the floating window.
4.      Observe that a new empty redundant window is created.You may need to drag the window aside to see  the other QDockWidget in it's own floating window. At this point you will have 4 windows - the QMainWindow instance, one each of the two dock widgets, and this mystery empty window.
5.      Now try to shut down the application from the application file menu.
6.      Observe that the app never terminates.

#### Note:

The redundant floating window is close-able but despite closing all of the windows, app shutdown is blocked. The user needs to manually force quit the application from activity monitor to quit the application.

The app asserts in debug mode when we try to dock any of the tabbed widgets into the redundant floating window.

#### Recording and callstack
* [tab_undock_creates_redundant_floating_window.mov](recordings+callstacks/issue-1--tab_undock_creates_redundant_floating_window.mov)
* [tab_undock_creates_redundant_floating_window.md](recordings+callstacks/issue-1--tab_undock_creates_redundant_floating_window.md)

## Issue 2 - Undocking tabbed widget from main window onto the floating window crashes app

1.      Launch the sample application. A main window with two docked group widgets will show.
2.      Undock one of the tabbed widgets by dragging the tab outside the main window to show a floating window with the tab contents.
3.      Undock the other tabbed widget from the main window and try to dock into the previously created floating window.
4.      Observe that the app crashes.

#### Recording and callstack
* [tab_docking_into_floating_window_crash.mov](recordings+callstacks/issue-2--tab_docking_into_floating_window_crash.mov)
* [tab_docking_into_floating_window_crash.md](recordings+callstacks/issue-2--tab_docking_into_floating_window_crash.md)
