mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
In RimProject, encode/decode into a string the currentIndex from QTreeView.
This will also make sure the active view is restored when opening a project p4#: 21463
This commit is contained in:
@@ -1428,10 +1428,13 @@ void RiuMainWindow::storeTreeViewState()
|
||||
if (m_treeView)
|
||||
{
|
||||
QString treeViewState;
|
||||
|
||||
m_treeView->storeTreeViewStateToString(treeViewState);
|
||||
|
||||
QString currentIndexString;
|
||||
RimUiTreeView::storeCurrentIndexToString(*m_treeView, currentIndexString);
|
||||
|
||||
RiaApplication::instance()->project()->treeViewState = treeViewState;
|
||||
RiaApplication::instance()->project()->currentModelIndexPath = currentIndexString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1448,6 +1451,12 @@ void RiuMainWindow::restoreTreeViewState()
|
||||
m_treeView->collapseAll();
|
||||
m_treeView->applyTreeViewStateFromString(stateString);
|
||||
}
|
||||
|
||||
QString currentIndexString = RiaApplication::instance()->project()->currentModelIndexPath;
|
||||
if (!currentIndexString.isEmpty())
|
||||
{
|
||||
RimUiTreeView::applyCurrentIndexFromString(*m_treeView, currentIndexString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user