Skip to content
Permalink
Browse files

reload visible filter on dataChange of table model and use the same (…

…renamed) slot (extendsChanged to reloadVisibleChanged
  • Loading branch information
signedav committed Mar 16, 2020
1 parent afbb37f commit eef36008b8895bc1d8f5170d8163c76b8e5632c4
@@ -313,12 +313,14 @@ void QgsAttributeTableFilterModel::setFilterMode( FilterMode filterMode )
{
if ( filterMode == ShowVisible )
{
connect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::extentsChanged );
connect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
connect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
generateListOfVisibleFeatures();
}
else
{
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::extentsChanged );
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
}

mFilterMode = filterMode;
@@ -371,7 +373,7 @@ bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModel
// returns are handled in their respective case statement above
}

void QgsAttributeTableFilterModel::extentsChanged()
void QgsAttributeTableFilterModel::reloadVisibleChanged()
{
generateListOfVisibleFeatures();
invalidateFilter();
@@ -255,10 +255,11 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub
public slots:

/**
* Is called upon every change of the visible extents on the map canvas.
* Is called upon every change of the visible extents on the map canvas or when data of
* the master table model changes.
* When a change is signalled, the filter is updated and invalidated if needed.
*/
void extentsChanged();
void reloadVisibleChanged();

private slots:
void selectionChanged();

0 comments on commit eef3600

Please sign in to comment.
You can’t perform that action at this time.