setFloating() called on the 2nd last dock widget in a floating tab didn't cause reparenting to the main window. The dock widget remained parented to a QDockWidgetGroupWindow, while no longer being part of floating tabs. The QDockWidgetGroupWindow would therefore have only one tab, which is an inconsistent state and causes crashes. Factor out the implementation of setFloating() to a new QDockWidgetPrivate::setFloating(). Reparent to the main window, if the dock widget is part of floating tabs. Add test functionality in tst_QDockWidget::setFloating(). Turn createFloatingTabs() into a macro, in order to QSKIP() in the test function's scope. Fixes: QTBUG-122394 Pick-to: 6.5 Change-Id: I3719785f310b131446cdea908f09b7195c992b3e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a910daf52678469b7e595da5fe54aa09ba2373c3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%