From: ouv Date: Mon, 21 Apr 2008 16:23:50 +0000 (+0000) Subject: Bug IPAL19264 - Qt4 porting. Application crashes after deletion of all entities of... X-Git-Tag: V5_0_0~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fad1b2ac20ac6a4f120e722adf62bc77b820220f;p=modules%2Fgui.git Bug IPAL19264 - Qt4 porting. Application crashes after deletion of all entities of exploded shape --- diff --git a/src/Qtx/QtxTreeView.cxx b/src/Qtx/QtxTreeView.cxx index 09100e5a7..c1dfc56b9 100644 --- a/src/Qtx/QtxTreeView.cxx +++ b/src/Qtx/QtxTreeView.cxx @@ -295,6 +295,18 @@ void QtxTreeView::selectionChanged( const QItemSelection& selected, emit( selectionChanged() ); } +/*! + \brief Called when rows are about to be removed. + \param parent model index + \param start first row to remove + \param end last row to remove +*/ +void QtxTreeView::rowsAboutToBeRemoved( const QModelIndex& parent, int start, int end ) +{ + setCurrentIndex( QModelIndex() ); + QTreeView::rowsAboutToBeRemoved( parent, start, end ); +} + /*! \brief Expand/collapse the specified item (recursively). \param index model index diff --git a/src/Qtx/QtxTreeView.h b/src/Qtx/QtxTreeView.h index 4d5935f8d..be10077a4 100644 --- a/src/Qtx/QtxTreeView.h +++ b/src/Qtx/QtxTreeView.h @@ -53,6 +53,7 @@ public: protected slots: void onHeaderClicked( int ); + void rowsAboutToBeRemoved( const QModelIndex&, int, int ); void selectionChanged( const QItemSelection&, const QItemSelection& ); protected: