mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Show context menu when selection is empty
p4#: 21233
This commit is contained in:
@@ -62,6 +62,16 @@ void RimUiTreeView::contextMenuEvent(QContextMenuEvent* event)
|
||||
{
|
||||
m_pasteAction->setEnabled(hasClipboardValidData());
|
||||
|
||||
if (selectionModel() && selectionModel()->selection().size() == 0)
|
||||
{
|
||||
// Clicking in blank space in tree view
|
||||
QMenu menu;
|
||||
menu.addAction(QString("New Grid Case Group"), this, SLOT(slotAddCaseGroup()));
|
||||
menu.exec(event->globalPos());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
RimUiTreeModelPdm* myModel = dynamic_cast<RimUiTreeModelPdm*>(model());
|
||||
if (myModel)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user