-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.9.1, 6.5.8, 6.8.3, 6.9.0
-
Windows 10 x64, Visual Studio 2017.
If you have a main window which has several tab windows in a group, with dockOptions set to a combo of nested | tabbed | groupedDragging.
Set the features flag of each tab to Movable | Floatable.
In the constructor of your window, set the tab areas to North so tabs are on top:
Snippet
setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::TabPosition::North);
Dragging the tabs from one dock area to another works fine.
However, floating one tab, then dragging another onto it exhibits a weird behavior: it flips the tab positions to South. Once you drag this floating group to a dock location, the tabs revert back to their usual location of North.
I believe I have found the code responsible for this:
https://github.com/openwebos/qt/blob/master/src/gui/widgets/qmainwindow.cpp
We see a lot of code like this which returns a default of South of the check fails:
| if (!checkDockWidgetArea(area, "QMainWindow::tabPosition")) |
return QTabWidget::South;
And if we look into that function, we see that it accounts for the 4 areas tabs can be docked at, but it does not account for what happens when a tab is floating and is not docked anywhere:
| static bool checkDockWidgetArea(Qt::DockWidgetArea area, const char *where) |
| { |
| switch (area) { |
| case Qt::LeftDockWidgetArea: |
| case Qt::RightDockWidgetArea: |
| case Qt::TopDockWidgetArea: |
| case Qt::BottomDockWidgetArea: |
| return true; |
| default: |
| break; |
| } |
| qWarning("%s: invalid 'area' argument", where); |
| return false; |
}
I think this might be easily fixable if we add an enum to account for the tabs being in a floating state.
Thank you.