]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update root index on changing of number of children
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 31 Aug 2015 09:23:54 +0000 (12:23 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 31 Aug 2015 09:24:06 +0000 (12:24 +0300)
src/XGUI/XGUI_DataModel.cpp

index 4a54e941ba977d5bda145a92dc6f5352dd580792..7d1a27cd58aef4f3bdafede0b0baba7d9003079a 100644 (file)
@@ -120,7 +120,7 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
               // Appears first object in folder which can not be shown empty
               insertRow(myXMLReader.subFolderId(aObjType), aDocRoot);
           }
-          int aRow = aDoc->size(aObjType) - 1;
+          int aRow = aDoc->index(aObject);
           int aNbSubFolders = foldersCount(aDoc.get());
           if (aObjType == aSubType) {
             // List of objects under document root
@@ -130,7 +130,9 @@ void XGUI_DataModel::processEvent(const std::shared_ptr<Events_Message>& theMess
             if (aRow != -1) {
               int aFolderId = folderId(aObjType, aDoc.get());
               if (aFolderId != -1) {
-                insertRow(aRow, createIndex(aFolderId, 0, aDoc.get()));
+                QModelIndex aParentFolder = createIndex(aFolderId, 0, aDoc.get());
+                insertRow(aRow, aParentFolder);
+                emit dataChanged(aParentFolder, aParentFolder);
               }
             }
           }