Insert new case group before script item

p4#: 20964
This commit is contained in:
Magne Sjaastad 2013-03-19 11:14:32 +01:00
parent 75fc89e67a
commit 414172cf78

View File

@ -513,7 +513,8 @@ RimIdenticalGridCaseGroup* RimUiTreeModelPdm::addCaseGroup(const QModelIndex& it
QModelIndex rootIndex = itemIndex.parent();
caf::PdmUiTreeItem* rootTreeItem = currentItem->parent();
int position = rootTreeItem->childCount();
// New case group is inserted before the last item, the script item
int position = rootTreeItem->childCount() - 1;
beginInsertRows(rootIndex, position, position);
@ -524,6 +525,8 @@ RimIdenticalGridCaseGroup* RimUiTreeModelPdm::addCaseGroup(const QModelIndex& it
endInsertRows();
rebuildUiSubTree(createdObject);
insertedModelIndex = index(position, 0, rootIndex);
return createdObject;