Merge pull request #32176 from 3nids/clear_warning

prevent clearing selection in QgsFeatureListView
This commit is contained in:
Matthias Kuhn 2019-10-29 08:07:24 +01:00 committed by GitHub
commit 3daf24c716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
{
@ -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
{