summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qmainwindowlayout.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2017-02-20 13:26:18 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2017-02-21 11:12:14 +0000
commitd57bb19902f863fc6db07674f6bd8881b0886b39 (patch)
treebb23213d63e2f66c4555248fb0a196cd9adbb43c /src/widgets/widgets/qmainwindowlayout.cpp
parent3cdf8debd1f8bd9d3ebe598e36b99548db8b6bc7 (diff)
Fix crash while dropping a tabbed group into a single floating QDockWidget
The problem was caused by commit 0feeb6f6d2cfaa964763ca1fcab65672812b4eef which fixed QTBUG-58036. It reparented widget that used to be skiped. In particular, floating widgets are skiped. But seting the parent of a floating widget docks it. And so as a result it would not be skiped anymore. This has two side effect: This breaks the animation (as the widget is docked too early; and cause crash when QDockWidgetGroupWindow get reparented as this breaks invariant that these are always floating. So restore the skip from before commit 0feeb6f6d2cfaa964763ca1fcab65672812b4eef, and explicitly set the parent in all cases when the animation finishes. Change-Id: I0e3e29ad22d6ffe4d62242d48a18dadb916fc14f Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qmainwindowlayout.cpp')
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index 68ca571acf..0d9c42fdf0 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -2195,10 +2195,8 @@ void QMainWindowLayout::animationFinished(QWidget *widget)
}
if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
- if (currentHoveredFloat) {
- dw->setParent(currentHoveredFloat);
- dw->show();
- }
+ dw->setParent(currentHoveredFloat ? currentHoveredFloat.data() : parentWidget());
+ dw->show();
dw->d_func()->plug(currentGapRect);
}
#endif