I am using QDockWidgets and placing two of them on the left side of my application so that tabs can be used to select between them. However, Qt\'s default behavior for this
As far as I can see from QDockWidget::mousePressEvent
implementation in src/gui/widgets/qdockwidget.cpp
dragging the dockwidgets using tabs is NOT possible:
QDockWidgetLayout *dwLayout
= qobject_cast(layout);
if (!dwLayout->nativeWindowDeco()) {
QRect titleArea = dwLayout->titleArea();
if (event->button() != Qt::LeftButton ||
!titleArea.contains(event->pos()) ||
// check if the tool window is movable... do nothing if it
// is not (but allow moving if the window is floating)
(!hasFeature(this, QDockWidget::DockWidgetMovable) && !q->isFloating()) ||
qobject_cast(parent) == 0 ||
isAnimating() || state != 0) {
return false;
}
initDrag(event->pos(), false);
....
As you can see from the implementation one of the things that the QDockWidget
checks before allowing undocking is whether the mouse press event has come from title bar or not.