diff options
Diffstat (limited to 'src/gui/widgets/qdockwidget.cpp')
-rw-r--r-- | src/gui/widgets/qdockwidget.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index 6710275..a8e2a37 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -685,8 +685,6 @@ void QDockWidgetPrivate::_q_toggleTopLevel() void QDockWidgetPrivate::initDrag(const QPoint &pos, bool nca) { - Q_Q(QDockWidget); - if (state != 0) return; @@ -694,8 +692,6 @@ void QDockWidgetPrivate::initDrag(const QPoint &pos, bool nca) Q_ASSERT(win != 0); QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); Q_ASSERT(layout != 0); - if (layout->layoutState.indexOf(q).isEmpty()) //The dock widget has not been added into the main window - return; if (layout->pluggingWidget != 0) // the main window is animating a docking operation return; @@ -1012,6 +1008,12 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect { Q_Q(QDockWidget); + if (!floating && parent) { + QMainWindowLayout *mwlayout = qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout()); + if (!mwlayout || mwlayout->dockWidgetArea(q) == Qt::NoDockWidgetArea) + return; // this dockwidget can't be redocked + } + bool wasFloating = q->isFloating(); bool hidden = q->isHidden(); |