Skip to content

Commit

Permalink
Merge pull request #32473 from qgis/backport-32176-to-release-3_10
Browse files Browse the repository at this point in the history
[Backport release-3_10] prevent clearing selection in QgsFeatureListView
  • Loading branch information
m-kuhn committed Oct 29, 2019
2 parents f2fd430 + 997f136 commit 4f9f366
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/attributetable/qgsfeaturelistview.cpp
Expand Up @@ -135,8 +135,10 @@ void QgsFeatureListView::mousePressEvent( QMouseEvent *event )

if ( QgsFeatureListViewDelegate::EditElement == mItemDelegate->positionToElement( event->pos() ) )
{

mEditSelectionDrag = true;
setEditSelection( mModel->mapToMaster( index ), QItemSelectionModel::ClearAndSelect );
if ( index.isValid() )
setEditSelection( mModel->mapToMaster( index ), QItemSelectionModel::ClearAndSelect );
}
else
{
Expand Down Expand Up @@ -233,7 +235,8 @@ void QgsFeatureListView::mouseMoveEvent( QMouseEvent *event )

if ( mEditSelectionDrag )
{
setEditSelection( mModel->mapToMaster( index ), QItemSelectionModel::ClearAndSelect );
if ( index.isValid() )
setEditSelection( mModel->mapToMaster( index ), QItemSelectionModel::ClearAndSelect );
}
else
{
Expand Down

0 comments on commit 4f9f366

Please sign in to comment.