From: vsv Date: Tue, 30 Oct 2018 14:38:17 +0000 (+0300) Subject: Fix for deletion of sub-nodes X-Git-Tag: End2018~229 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2120b20d9e38f801db4c09123c747bea15ceef8e;p=modules%2Fshaper.git Fix for deletion of sub-nodes --- 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); } }