Skip to content

Commit 99bbf4a

Browse files
committedMay 6, 2020
Update the title by calling filterChanged on signals of the QgsAttributeTableFilterModel 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.
1 parent c820d0f commit 99bbf4a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/gui/attributetable/qgsdualview.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,11 +248,13 @@ void QgsDualView::setFilterMode( QgsAttributeTableFilterModel::FilterMode filter
248248
{
249249
case QgsAttributeTableFilterModel::ShowVisible:
250250
disconnect( mFilterModel->mapCanvas(), &QgsMapCanvas::extentsChanged, this, &QgsDualView::extentChanged );
251+
disconnect( mFilterModel, &QgsAttributeTableFilterModel::visibleReloaded, this, &QgsDualView::filterChanged );
251252
break;
252253

253254
case QgsAttributeTableFilterModel::ShowAll:
254255
case QgsAttributeTableFilterModel::ShowEdited:
255256
case QgsAttributeTableFilterModel::ShowFilteredList:
257+
disconnect( mFilterModel, &QgsAttributeTableFilterModel::featuresFiltered, this, &QgsDualView::filterChanged );
256258
break;
257259

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

290293
case QgsAttributeTableFilterModel::ShowAll:
291294
case QgsAttributeTableFilterModel::ShowEdited:
292295
case QgsAttributeTableFilterModel::ShowFilteredList:
296+
disconnect( mFilterModel, &QgsAttributeTableFilterModel::featuresFiltered, this, &QgsDualView::filterChanged );
293297
break;
294298

295299
case QgsAttributeTableFilterModel::ShowSelected:

0 commit comments

Comments
 (0)
Please sign in to comment.