From 28e7e8efc9ae817aa30e778cb96ade3923159f46 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 31 Jul 2014 14:04:37 +0200 Subject: [PATCH] Added special handling to expand an item in tree view --- ApplicationCode/UserInterface/RiuMainWindow.cpp | 12 ++++++++++++ ApplicationCode/UserInterface/RiuMainWindow.h | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/UserInterface/RiuMainWindow.cpp b/ApplicationCode/UserInterface/RiuMainWindow.cpp index a5c475fcfe..e6cab5e794 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationCode/UserInterface/RiuMainWindow.cpp @@ -2010,3 +2010,15 @@ void RiuMainWindow::appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObje menu->addAction(m_openMultipleEclipseCasesAction); } } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RiuMainWindow::setExpanded(const caf::PdmObject* pdmObject, bool expanded) +{ + QModelIndex mi = m_treeModelPdm->getModelIndexFromPdmObject(pdmObject); + if (m_treeView && mi.isValid()) + { + m_treeView->setExpanded(mi, expanded); + } +} diff --git a/ApplicationCode/UserInterface/RiuMainWindow.h b/ApplicationCode/UserInterface/RiuMainWindow.h index 0e2aa40bee..42e1a7c8f2 100644 --- a/ApplicationCode/UserInterface/RiuMainWindow.h +++ b/ApplicationCode/UserInterface/RiuMainWindow.h @@ -97,7 +97,8 @@ public: void appendActionsContextMenuForPdmObject(caf::PdmObject* pdmObject, QMenu* menu); void refreshDrawStyleActions(); - + + void setExpanded(const caf::PdmObject* pdmObject, bool expanded); protected: virtual void closeEvent(QCloseEvent* event);