Added general function used to remove(and delete) pdmObject from pdmPointersField

Used when closing a grid group
p4#: 20992
This commit is contained in:
Magne Sjaastad
2013-03-20 12:08:40 +01:00
parent 9abe7a3b13
commit 06a2f7e17f
4 changed files with 57 additions and 0 deletions

View File

@@ -181,6 +181,7 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
QMenu menu;
menu.addAction(QString("New Case Group"), this, SLOT(slotAddCaseGroup()));
menu.addAction(QString("Paste"), this, SLOT(slotPastePdmObjects()));
menu.addAction(QString("Close"), this, SLOT(slotDeleteObjectFromPdmPointersField()));
menu.exec(event->globalPos());
}
else if (dynamic_cast<RimCaseCollection*>(uiItem->dataObject().p()))
@@ -836,6 +837,18 @@ void RimUiTreeView::slotAddCaseGroup()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimUiTreeView::slotDeleteObjectFromPdmPointersField()
{
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
if (myModel)
{
myModel->deleteObjectFromPdmPointersField(currentIndex());
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------