mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-13 17:02:13 -05:00
Show properties for selected object in main project tree
There can be several project trees in a project. Ensure that the selected object in the main project tree is displayed in the property editor.
This commit is contained in:
1 parent
742bb5f0d2
commit
015f248dd9
2 files changed
+38
No files matched your search
@@ -254,6 +254,25 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
|
|||||||
activeSubWindow->showMaximized();
|
activeSubWindow->showMaximized();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the project tree and reselect items to trigger the selectionChanged signal. This will make sure that the property view is
|
||||||
|
// updated based on the selection in the main project tree.
|
||||||
|
if ( auto dockWidget = RiuDockWidgetTools::findDockWidget( dockManager(), RiuDockWidgetTools::mainWindowProjectTreeName() ) )
|
||||||
|
{
|
||||||
|
if ( auto tree = dynamic_cast<caf::PdmUiTreeView*>( dockWidget->widget() ) )
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmUiItem*> uiItems;
|
||||||
|
tree->selectedUiItems( uiItems );
|
||||||
|
|
||||||
|
std::vector<const caf::PdmUiItem*> constSelectedItems;
|
||||||
|
for ( auto item : uiItems )
|
||||||
|
{
|
||||||
|
constSelectedItems.push_back( item );
|
||||||
|
}
|
||||||
|
|
||||||
|
tree->selectItems( constSelectedItems );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -218,6 +218,25 @@ void RiuPlotMainWindow::initializeGuiNewProjectLoaded()
|
|||||||
}
|
}
|
||||||
|
|
||||||
refreshToolbars();
|
refreshToolbars();
|
||||||
|
|
||||||
|
// Find the project tree and reselect items to trigger the selectionChanged signal. This will make sure that the property view is
|
||||||
|
// updated based on the selection in the main project tree.
|
||||||
|
if ( auto dockWidget = RiuDockWidgetTools::findDockWidget( dockManager(), RiuDockWidgetTools::plotMainWindowPlotsTreeName() ) )
|
||||||
|
{
|
||||||
|
if ( auto tree = dynamic_cast<caf::PdmUiTreeView*>( dockWidget->widget() ) )
|
||||||
|
{
|
||||||
|
std::vector<caf::PdmUiItem*> uiItems;
|
||||||
|
tree->selectedUiItems( uiItems );
|
||||||
|
|
||||||
|
std::vector<const caf::PdmUiItem*> constSelectedItems;
|
||||||
|
for ( auto item : uiItems )
|
||||||
|
{
|
||||||
|
constSelectedItems.push_back( item );
|
||||||
|
}
|
||||||
|
|
||||||
|
tree->selectItems( constSelectedItems );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in new issue
Block a user