Description: fix notification of QDockWidget when it gets undocked Before the patch the notification was emitted only when the docker was attached to the panel or changed a position on it. . It looks like the old behavior was documented in a unittest, so this patch might actually be a "behavior change". . Note: https://mail.kde.org/pipermail/distributions/2019-April/000317.html Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=06b8644953fc5267 Last-Update: 2019-06-14 --- a/src/widgets/widgets/qdockwidget.cpp +++ b/src/widgets/widgets/qdockwidget.cpp @@ -1171,6 +1171,8 @@ void QDockWidgetPrivate::setWindowState( QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q); if (mwlayout) emit q->dockLocationChanged(mwlayout->dockWidgetArea(q)); + } else { + emit q->dockLocationChanged(Qt::NoDockWidgetArea); } } --- a/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp +++ b/tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp @@ -669,7 +669,11 @@ void tst_QDockWidget::dockLocationChange spy.clear(); dw.setFloating(true); - QTest::qWait(100); + QTRY_COMPARE(spy.count(), 1); + QCOMPARE(qvariant_cast(spy.at(0).at(0)), + Qt::NoDockWidgetArea); + spy.clear(); + dw.setFloating(false); QTRY_COMPARE(spy.count(), 1); QCOMPARE(qvariant_cast(spy.at(0).at(0)),