From 2120b20d9e38f801db4c09123c747bea15ceef8e 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