Skip to content

Commit

Permalink
Update the title by calling filterChanged on signals of the QgsAttrib…
Browse files Browse the repository at this point in the history
…uteTableFilterModel like visibleReloaded or featureFiltered. This has to be done on the one hand, because the final filtering on QgsAttributeTableFilterModel has been done on QgsAttributeTableModel::finished what is sometimes done after the filterChanged on QgsDualView is emmited, and on the other hand in case the filtering on QgsAttributeTableFilterModel has been done from otherwhere. Possibly it's called more than one time on a filtering, but since it's only sets the title in the end this is not bad.
  • Loading branch information
signedav committed May 6, 2020
1 parent c820d0f commit 99bbf4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/attributetable/qgsdualview.cpp
Expand Up @@ -248,11 +248,13 @@ void QgsDualView::setFilterMode( QgsAttributeTableFilterModel::FilterMode filter
{
case QgsAttributeTableFilterModel::ShowVisible:
disconnect( mFilterModel->mapCanvas(), &QgsMapCanvas::extentsChanged, this, &QgsDualView::extentChanged );
disconnect( mFilterModel, &QgsAttributeTableFilterModel::visibleReloaded, this, &QgsDualView::filterChanged );
break;

case QgsAttributeTableFilterModel::ShowAll:
case QgsAttributeTableFilterModel::ShowEdited:
case QgsAttributeTableFilterModel::ShowFilteredList:
disconnect( mFilterModel, &QgsAttributeTableFilterModel::featuresFiltered, this, &QgsDualView::filterChanged );
break;

case QgsAttributeTableFilterModel::ShowSelected:
Expand Down Expand Up @@ -285,11 +287,13 @@ void QgsDualView::setFilterMode( QgsAttributeTableFilterModel::FilterMode filter
QgsRectangle rect = mFilterModel->mapCanvas()->mapSettings().mapToLayerCoordinates( mLayer, mFilterModel->mapCanvas()->extent() );
r.setFilterRect( rect );
}
connect( mFilterModel, &QgsAttributeTableFilterModel::visibleReloaded, this, &QgsDualView::filterChanged );
break;

case QgsAttributeTableFilterModel::ShowAll:
case QgsAttributeTableFilterModel::ShowEdited:
case QgsAttributeTableFilterModel::ShowFilteredList:
disconnect( mFilterModel, &QgsAttributeTableFilterModel::featuresFiltered, this, &QgsDualView::filterChanged );
break;

case QgsAttributeTableFilterModel::ShowSelected:
Expand Down

0 comments on commit 99bbf4a

Please sign in to comment.