From 14e27937087d689c108f45d531eb9223ad2c62fe Mon Sep 17 00:00:00 2001 From: vsv Date: Tue, 30 Oct 2018 17:38:17 +0300 Subject: [PATCH] Fix for deletion of sub-nodes --- src/XGUI/XGUI_DataModel.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index f2cfa898a..92a4bc67c 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -135,22 +135,11 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess foreach(ObjectPtr aObj, aCreated) { ModuleBase_ITreeNode* aNode = myRoot->subNode(aObj); if (aNode) { - int aOldNb = aNode->childrenCount(); aNode->update(); - int aNewNb = aNode->childrenCount(); - + rebuildDataTree(); QModelIndex aFirstIdx = getIndex(aNode, 0); QModelIndex aLastIdx = getIndex(aNode, 2); - if (aNewNb > aOldNb) { - insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx); - } - else if (aNewNb < aOldNb) { - if (aNewNb) - removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx); - else if (aOldNb) - removeRows(0, aOldNb, aFirstIdx); - } dataChanged(aFirstIdx, aLastIdx); } } -- 2.39.2