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 eef3600 commit 1f5353714678ff77dbf184e93991849b52e5c7bb
@@ -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,14 +313,14 @@ void QgsAttributeTableFilterModel::setFilterMode( FilterMode filterMode )
{
if ( filterMode == ShowVisible )
{
connect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
connect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
connect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
connect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
generateListOfVisibleFeatures();
}
else
{
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisibleChanged );
disconnect( mCanvas, &QgsMapCanvas::extentsChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
disconnect( mTableModel, &QgsAttributeTableModel::dataChanged, this, &QgsAttributeTableFilterModel::reloadVisible );
}

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

void QgsAttributeTableFilterModel::reloadVisibleChanged()
void QgsAttributeTableFilterModel::reloadVisible()
{
generateListOfVisibleFeatures();
invalidateFilter();
@@ -259,7 +259,7 @@ class GUI_EXPORT QgsAttributeTableFilterModel: public QSortFilterProxyModel, pub
* the master table model changes.
* When a change is signalled, the filter is updated and invalidated if needed.
*/
void reloadVisibleChanged();
void reloadVisible();

private slots:
void selectionChanged();

0 comments on commit 1f53537

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