diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 11:27:37 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-01-26 11:27:37 +0000 |
commit | 0a1af55a9b69f7fd58dbce43a0d4c1faf0143838 (patch) | |
tree | 26da168e740734d168be37803abec2f8739b213d /src/widgets/widgets/qmainwindowlayout.cpp | |
parent | b8fb0ee999d32401157be8d86e5a03185aadbb9e (diff) | |
parent | 158a3a4159bdc5a49caecd63e021dacbc06cf23c (diff) |
Merge "Merge remote-tracking branch 'origin/5.6' into dev" into refs/staging/dev
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindowlayout.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 908aedff84..b695918406 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -2258,17 +2258,18 @@ void QMainWindowLayout::setCentralWidget(QWidget *widget) QLayoutItem *QMainWindowLayout::unplug(QWidget *widget, bool group) { #if !defined(QT_NO_DOCKWIDGET) && !defined(QT_NO_TABBAR) - QDockWidgetGroupWindow *floatingParent = qobject_cast<QDockWidgetGroupWindow *>(widget->parentWidget()); - if (group && floatingParent && !widget->isWindow()) { - // We are just dragging a floating window as it, not need to do anything, we just have to - // look up the corresponding QWidgetItem* if it exists - QList<int> tabbedWindowPath = layoutState.indexOf(widget->parentWidget()); - return tabbedWindowPath.isEmpty() ? 0 : layoutState.item(tabbedWindowPath); - } else if (floatingParent) { - // We are unplugging a dock widget from a floating window. - if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) { - dw->d_func()->unplug(widget->geometry()); - return 0; + if (!widget->isWindow() && qobject_cast<const QDockWidgetGroupWindow *>(widget->parentWidget())) { + if (group) { + // We are just dragging a floating window as it, not need to do anything, we just have to + // look up the corresponding QWidgetItem* if it exists + QList<int> tabbedWindowPath = layoutState.indexOf(widget->parentWidget()); + return tabbedWindowPath.isEmpty() ? 0 : layoutState.item(tabbedWindowPath); + } else { + // We are unplugging a dock widget from a floating window. + if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) { + dw->d_func()->unplug(widget->geometry()); + return 0; + } } } #endif |