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 18dddffeab77bc54f095238e164220bad7ce9526
@@ -234,9 +234,10 @@ selection state of the feature in case selected features are to be shown on top.

public slots:

void extentsChanged();
void reloadVisible();
%Docstring
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.
%End

@@ -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::reloadVisible );
connect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
generateListOfVisibleFeatures();
}
else
{
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::extentsChanged );
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
}

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::reloadVisible()
{
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 reloadVisible();

private slots:
void selectionChanged();

0 comments on commit 18dddff

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