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 )
+{
+ QModelIndex curIndex = currentIndex();
+ while ( curIndex.isValid() && curIndex.parent() != parent )
+ curIndex = curIndex.parent();
+ if ( curIndex.isValid() && curIndex.row() >= start && curIndex.row() <= end )
+ setCurrentIndex( QModelIndex() );
+ QTreeView::rowsAboutToBeRemoved( parent, start, end );
+}
+
/*!
\brief Expand/collapse the specified item (recursively).
\param index model index
protected slots:
void onHeaderClicked( int );
+ void rowsAboutToBeRemoved( const QModelIndex&, int, int );
void selectionChanged( const QItemSelection&, const QItemSelection& );
void onAppropriate( Qt::Orientation, int, int );