Fix restoring side-bar widget when it was deleted previously
We need to consult the user's widget factory, just as we do for other cases where the dock widget is missing
This commit is contained in:
@@ -667,7 +667,7 @@ bool MainWindowBase::deserialize(const LayoutSaver::MainWindow &mw)
|
||||
const QStringList dockWidgets = mw.dockWidgetsPerSideBar.value(loc);
|
||||
for (const QString &uniqueName : dockWidgets) {
|
||||
|
||||
DockWidgetBase *dw = DockRegistry::self()->dockByName(uniqueName);
|
||||
DockWidgetBase *dw = DockRegistry::self()->dockByName(uniqueName, DockRegistry::DockByNameFlag::CreateIfNotFound);
|
||||
if (!dw) {
|
||||
qWarning() << Q_FUNC_INFO << "Could not find dock widget" << uniqueName
|
||||
<< ". Won't restore it to sidebar";
|
||||
|
||||
@@ -6952,7 +6952,7 @@ void TestDocks::tst_deleteOnClose()
|
||||
QVERIFY(Testing::waitForDeleted(dock1));
|
||||
QVERIFY(!dock1.data());
|
||||
|
||||
//saver.restoreLayout(saved);
|
||||
saver.restoreLayout(saved);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user