Skip to content

Commit

Permalink
Open both model and root system when creating a new SSP model (#7107)
Browse files Browse the repository at this point in the history
Fixes #7103
  • Loading branch information
adeas31 committed Jan 25, 2021
1 parent 41cdb12 commit 17361aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions OMEdit/OMEditLIB/OMS/ModelDialog.cpp
Expand Up @@ -157,6 +157,17 @@ void CreateModelDialog::createNewModel()
LibraryTreeItem *pLibraryTreeItem = pLibraryTreeModel->createLibraryTreeItem(mpNameTextBox->text(), mpNameTextBox->text(), "", false, pLibraryTreeModel->getRootLibraryTreeItem());
if (pLibraryTreeItem) {
pLibraryTreeModel->showModelWidget(pLibraryTreeItem);
// expand the ssp model
QModelIndex modelIndex = pLibraryTreeModel->libraryTreeItemIndex(pLibraryTreeItem);
QModelIndex proxyIndex = MainWindow::instance()->getLibraryWidget()->getLibraryTreeProxyModel()->mapFromSource(modelIndex);
MainWindow::instance()->getLibraryWidget()->getLibraryTreeView()->expand(proxyIndex);
// open the root system inside it
if (pLibraryTreeItem->childrenSize() > 0) {
LibraryTreeItem *pRootSystemLibraryTreeItem = pLibraryTreeItem->childAt(0);
if (pRootSystemLibraryTreeItem) {
pLibraryTreeModel->showModelWidget(pRootSystemLibraryTreeItem);
}
}
}
accept();
} else {
Expand Down

0 comments on commit 17361aa

Please sign in to comment.