mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06: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:
parent
742bb5f0d2
commit
015f248dd9
@ -254,6 +254,25 @@ void RiuMainWindow::initializeGuiNewProjectLoaded()
|
||||
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();
|
||||
|
||||
// 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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user