Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.9.0
-
None
Description
For QMainWindow, developer can make QToolBars dock to the docking area by calling QMainWindow::addToolBar, however, there's no way to make a docked tool bar become floating again programmatically. Calling QMainWindow::removeToolBar seems to break the tool bar's layout. Developer can create a new tool bar without calling QMainWindow::addToolBar, the tool bar will indeed looks floating visually, but dragging such tool bars (floating tool bars that aren't caused by user dragging, including the ones caused by calling QMainWindow::removeToolBar) will always cause assertion failure. I have checked QToolBar's source code, I saw when user try to drag the tool bar, it will always try to undock from QMainWindow's internal layout first, that's where the assertion failure come from. I just don't understand why QToolBar must be docked into the docking area first to be able to become floating. I think adding some API like "QToolBar::setFloating" would be much more convenient.