Added context menu for adding new case group

p4#: 20905
This commit is contained in:
Magne Sjaastad
2013-03-14 09:50:40 +01:00
parent 469c5a9657
commit e92ed43fc3
4 changed files with 57 additions and 0 deletions

View File

@@ -165,6 +165,12 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
menu.addAction(QString("New View"), this, SLOT(slotAddView()));
menu.exec(event->globalPos());
}
else if (dynamic_cast<RimIdenticalGridCaseGroup*>(uiItem->dataObject().p()))
{
QMenu menu;
menu.addAction(QString("New Case Group"), this, SLOT(slotAddCaseGroup()));
menu.exec(event->globalPos());
}
}
}
}
@@ -796,3 +802,17 @@ void RimUiTreeView::slotComputeStatisticalCases()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimUiTreeView::slotAddCaseGroup()
{
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
if (myModel)
{
QModelIndex insertedIndex;
myModel->addCaseGroup(currentIndex(), insertedIndex);
setCurrentIndex(insertedIndex);
}
}