From: vsr Date: Tue, 31 Jul 2007 13:47:14 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: qt4_porting_delivery_220807~63 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5a6d60c38e76ec61c0cefa52b183b90af8061dc;p=modules%2Fgui.git *** empty log message *** --- diff --git a/src/Qtx/QtxTreeView.cxx b/src/Qtx/QtxTreeView.cxx index d7a52ebc7..15acdb6f2 100644 --- a/src/Qtx/QtxTreeView.cxx +++ b/src/Qtx/QtxTreeView.cxx @@ -226,6 +226,26 @@ void QtxTreeView::collapseLevels( const int levels ) setOpened( rootIndex(), levels+1, false ); } +/*! + \brief Expand the branch specifed by the \index and all its + children recursively. + \param index model index to be expanded +*/ +void QtxTreeView::expandAll( const QModelIndex& index ) +{ + setOpened( index, -1, true ); +} + +/*! + \brief Collapse the branch specifed by the \index and all its + children recursively. + \param index model index to be collapsed +*/ +void QtxTreeView::collapseAll( const QModelIndex& index ) +{ + setOpened( index, -1, false ); +} + /* \brief Enable/disable "Sorting" popup menu command for the header. \param enableSortMenu if \c true, enable "Sorting" menu command diff --git a/src/Qtx/QtxTreeView.h b/src/Qtx/QtxTreeView.h index 0d760caf1..0f0971227 100644 --- a/src/Qtx/QtxTreeView.h +++ b/src/Qtx/QtxTreeView.h @@ -45,6 +45,9 @@ public: void expandLevels( const int ); void collapseLevels( const int ); + void expandAll( const QModelIndex& ); + void collapseAll( const QModelIndex& ); + void setSortMenuEnabled( const bool ); bool sortMenuEnabled() const;