Don't crash when using LayoutSaver with MDI

It's not supported but it shouldn't crash.
For #352, leaving it open still, as the reporter actually experiences
an assert, not a segfault. To be investigated further
This commit is contained in:
Sergio Martins
2023-03-14 22:54:46 +00:00
parent 4d50376ccf
commit 1a46823b03
2 changed files with 7 additions and 2 deletions

View File

@@ -7797,6 +7797,11 @@ void TestDocks::tst_addMDIDockWidget()
auto m = createMainWindow(QSize(800, 500), MainWindowOption_MDI);
auto dock0 = createDockWidget("dock0", new MyWidget2(QSize(400, 400)));
qobject_cast<MDILayoutWidget *>(m->layoutWidget())->addDockWidget(dock0, QPoint(0, 0), {});
// MDI doesn't support LayoutSaver yet, but it was crashing, so add a test
// to catch further crashes
LayoutSaver saver;
const QByteArray saved = saver.serializeLayout();
}
void TestDocks::tst_redockToMDIRestoresPosition()