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". Change-Id: Id3ffbd2018a8e68844d174328dd1c4ceb7fa01d3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
parent
92f9842732
commit
06b8644953
|
|
@ -1182,6 +1182,8 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect
|
|||
QMainWindowLayout *mwlayout = qt_mainwindow_layout_from_dock(q);
|
||||
if (mwlayout)
|
||||
emit q->dockLocationChanged(mwlayout->dockWidgetArea(q));
|
||||
} else {
|
||||
emit q->dockLocationChanged(Qt::NoDockWidgetArea);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -670,7 +670,11 @@ void tst_QDockWidget::dockLocationChanged()
|
|||
spy.clear();
|
||||
|
||||
dw.setFloating(true);
|
||||
QTest::qWait(100);
|
||||
QTRY_COMPARE(spy.count(), 1);
|
||||
QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
|
||||
Qt::NoDockWidgetArea);
|
||||
spy.clear();
|
||||
|
||||
dw.setFloating(false);
|
||||
QTRY_COMPARE(spy.count(), 1);
|
||||
QCOMPARE(qvariant_cast<Qt::DockWidgetArea>(spy.at(0).at(0)),
|
||||
|
|
|
|||
Loading…
Reference in New Issue