(#378) Added an tree view expansion interface

This commit is contained in:
Jacob Støren 2015-08-14 18:03:51 +02:00
parent 6244cf98bf
commit e805c893c6
4 changed files with 20 additions and 1 deletions

View File

@ -147,5 +147,13 @@ void PdmUiTreeView::selectAsCurrentItem(PdmUiItem* uiItem)
m_treeViewEditor->selectAsCurrentItem(uiItem);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmUiTreeView::setExpanded(const PdmUiItem* uiItem, bool doExpand) const
{
m_treeViewEditor->setExpanded(uiItem, doExpand);
}
} //End of namespace caf

View File

@ -71,6 +71,7 @@ public:
void selectedObjects(std::vector<PdmUiItem*>& objects);
void selectAsCurrentItem(PdmUiItem* uiItem);
void setExpanded(const PdmUiItem* uiItem, bool doExpand) const ;
signals:
void selectionChanged();

View File

@ -265,5 +265,14 @@ void PdmUiTreeViewEditor::slotOnSelectionChanged(const QItemSelection & selected
emit selectionChanged();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmUiTreeViewEditor::setExpanded(const PdmUiItem* uiItem, bool doExpand) const
{
QModelIndex index = m_treeViewModel->findModelIndex(uiItem);
m_treeView->setExpanded(index, doExpand);
}
} // end namespace caf

View File

@ -89,7 +89,8 @@ public:
void selectAsCurrentItem(PdmUiItem* uiItem);
void selectedUiItems(std::vector<PdmUiItem*>& objects);
void setExpanded(const PdmUiItem* uiItem, bool doExpand) const;
QWidget* createWidget(QWidget* parent);
signals: