From fad1b2ac20ac6a4f120e722adf62bc77b820220f Mon Sep 17 00:00:00 2001 From: ouv Date: Mon, 21 Apr 2008 16:23:50 +0000 Subject: [PATCH] Bug IPAL19264 - Qt4 porting. Application crashes after deletion of all entities of exploded shape --- src/Qtx/QtxTreeView.cxx | 12 ++++++++++++ src/Qtx/QtxTreeView.h | 1 + 2 files changed, 13 insertions(+) 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: -- 2.39.2