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:
Magne Sjaastad
2013-04-26 19:05:35 +02:00
parent 3806ff9baf
commit ab8dfb4aad
5 changed files with 66 additions and 1 deletions

View File

@@ -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);
}
}
}