1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00

Handle Element root changing type

This commit is contained in:
uramer 2023-11-11 13:51:22 +01:00
parent 919e067ab7
commit 4ba2aca3d3

View File

@ -269,7 +269,12 @@ namespace LuaUi
if (mRoot->widget()->getTypeName() != widgetType(layout()))
{
destroyRoot(mRoot);
WidgetExtension* parent = mRoot->getParent();
auto children = parent->children();
auto it = std::find(children.begin(), children.end(), mRoot);
mRoot = createWidget(layout(), 0);
*it = mRoot;
parent->setChildren(children);
}
else
{