Skip to content

Commit

Permalink
[Fix #7784] Browser keeps crashing when navigating the tree
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 13, 2013
1 parent b5c540f commit 110b87e
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/gui/attributetable/qgsattributetableview.cpp
Expand Up @@ -120,11 +120,16 @@ void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel* filterModel
QTableView::setModel( filterModel );

delete mFeatureSelectionModel;
mFeatureSelectionModel = new QgsFeatureSelectionModel( mFilterModel, mFilterModel, mFilterModel->layer(), mFilterModel );
setSelectionModel( mFeatureSelectionModel );
mTableDelegate->setFeatureSelectionModel( mFeatureSelectionModel );
connect( mFeatureSelectionModel, SIGNAL( requestRepaint( QModelIndexList ) ), this, SLOT( repaintRequested( QModelIndexList ) ) );
connect( mFeatureSelectionModel, SIGNAL( requestRepaint() ), this, SLOT( repaintRequested() ) );
mFeatureSelectionModel = NULL;

if ( filterModel )
{
mFeatureSelectionModel = new QgsFeatureSelectionModel( mFilterModel, mFilterModel, mFilterModel->layer(), mFilterModel );
setSelectionModel( mFeatureSelectionModel );
mTableDelegate->setFeatureSelectionModel( mFeatureSelectionModel );
connect( mFeatureSelectionModel, SIGNAL( requestRepaint( QModelIndexList ) ), this, SLOT( repaintRequested( QModelIndexList ) ) );
connect( mFeatureSelectionModel, SIGNAL( requestRepaint() ), this, SLOT( repaintRequested() ) );
}
}

void QgsAttributeTableView::closeEvent( QCloseEvent *e )
Expand Down

0 comments on commit 110b87e

Please sign in to comment.