Thanks for the reply,
eventually, I found the solution: remove unnecessary conditions from QDockWidgetPrivate class (mousePressEvent) and rebuild QtGui.
bool QDockWidgetPrivate
::mousePressEvent(QMouseEvent *event
) {
#if !defined(QT_NO_MAINWINDOW)
QDockWidgetLayout *dwLayout
= qobject_cast<QDockWidgetLayout*>(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<QMainWindow*>(parent) == 0 ||
isAnimating() || state != 0) {
return false;
}
initDrag(event->pos(), false);
if (state)
state
->ctrlDrag
= hasFeature
(this,
QDockWidget::DockWidgetFloatable) && event
->modifiers
() & Qt
::ControlModifier;
return true;
}
#endif // !defined(QT_NO_MAINWINDOW)
return false;
}
bool QDockWidgetPrivate::mousePressEvent(QMouseEvent *event)
{
#if !defined(QT_NO_MAINWINDOW)
Q_Q(QDockWidget);
QDockWidgetLayout *dwLayout
= qobject_cast<QDockWidgetLayout*>(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<QMainWindow*>(parent) == 0 ||
isAnimating() || state != 0) {
return false;
}
initDrag(event->pos(), false);
if (state)
state->ctrlDrag = hasFeature(this, QDockWidget::DockWidgetFloatable) && event->modifiers() & Qt::ControlModifier;
return true;
}
#endif // !defined(QT_NO_MAINWINDOW)
return false;
}
To copy to clipboard, switch view to plain text mode
Line number 13 above.
Bookmarks