mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Prototyped commands for new treeview
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
#include "RimGeoMechModels.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
@@ -558,6 +559,9 @@ void RiuMainWindow::createDockPanels()
|
||||
|
||||
connect(m_projectTreeView->treeView()->selectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)),
|
||||
this, SLOT(selectedObjectsChanged(const QItemSelection&, const QItemSelection &)));
|
||||
m_projectTreeView->treeView()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(m_projectTreeView->treeView(), SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(customMenuRequested(const QPoint&)));
|
||||
|
||||
|
||||
// MODTODO
|
||||
//m_windowsMenu->addAction(dockWidget->toggleViewAction());
|
||||
@@ -2190,11 +2194,33 @@ void RiuMainWindow::forceProjectTreeRepaint()
|
||||
m_OBSOLETE_treeView->scroll(0,-1);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::selectedObjectsChanged(const QItemSelection& selected, const QItemSelection & deselected)
|
||||
{
|
||||
std::vector<caf::PdmUiItem*> uiItems;
|
||||
m_projectTreeView->selectedObjects(uiItems);
|
||||
|
||||
// MODTODO
|
||||
|
||||
// Wire up update of property editor
|
||||
|
||||
caf::SelectionManager::instance()->setSelectedItems(uiItems);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::customMenuRequested(const QPoint& pos)
|
||||
{
|
||||
QMenu menu;
|
||||
|
||||
std::vector<QAction*> actions;
|
||||
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
app->project()->actionsBasedOnSelection(actions);
|
||||
|
||||
for (size_t i = 0; i < actions.size(); i++)
|
||||
{
|
||||
menu.addAction(actions[i]);
|
||||
}
|
||||
|
||||
menu.exec(pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user