Skip to content

Commit

Permalink
on ensuring the selection, the dependend objects (like feature info a…
Browse files Browse the repository at this point in the history
…nd count of features) in the gui need to be updated even if the selection is not affected. This fixes that on adding or removing features the counter on the GUI will be updated.
  • Loading branch information
signedav committed Mar 16, 2020
1 parent 00492ca commit d409c65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/attributetable/qgsfeaturelistview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ void QgsFeatureListView::editSelectionChanged( const QItemSelection &deselected,
QItemSelection localSelected = mModel->mapSelectionFromMaster( selected );
viewport()->update( visualRegionForSelection( localDeselected ) | visualRegionForSelection( localSelected ) );
}
updateEditSelectionDependencies();
}

void QgsFeatureListView::updateEditSelectionDependencies()
{
QItemSelection currentSelection = mCurrentEditSelectionModel->selection();
if ( currentSelection.size() == 1 )
{
Expand Down Expand Up @@ -463,6 +467,7 @@ void QgsFeatureListView::ensureEditSelection( bool inSelection )
}
mUpdateEditSelectionTimer.start();
}
updateEditSelectionDependencies();
}

void QgsFeatureListView::setFeatureSelectionManager( QgsIFeatureSelectionManager *featureSelectionManager )
Expand Down
5 changes: 5 additions & 0 deletions src/gui/attributetable/qgsfeaturelistview.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@ class GUI_EXPORT QgsFeatureListView : public QListView
private slots:
void editSelectionChanged( const QItemSelection &deselected, const QItemSelection &selected );

/**
* Emmits the signal for the feature and the selection information
*/
void updateEditSelectionDependencies();

/**
* Make sure, there is an edit selection. If there is none, choose the first item.
* If \a inSelection is set to TRUE, the edit selection is done in selected entries if
Expand Down

0 comments on commit d409c65

Please sign in to comment.