The standard way of update "Light" data models is provided. To use it, it is necessary to reimplement virtual method build and (if necessary) updateWidgets. By standard way, the children of first level are disconnected from parent (setParent(0)), after that new data model is created (using virtual method build), with help of updateWidgets all widgets are updated in order to show correct data model (by standard, this is only object browser) and after that all old objects are deleted.
Method build must only create objects, it is forbidden to delete them there