Skip to content
Permalink
Browse files

Fix form filtering when used in feature selection dialog

  • Loading branch information
troopa81 committed Feb 6, 2020
1 parent dc9b82a commit bcd401df505cb856406c86acabac5bc93b133a8c
Showing with 23 additions and 0 deletions.
  1. +13 −0 src/gui/qgsfeatureselectiondlg.cpp
  2. +10 −0 src/gui/qgsfeatureselectiondlg.h
@@ -50,6 +50,9 @@ QgsFeatureSelectionDlg::QgsFeatureSelectionDlg( QgsVectorLayer *vl, const QgsAtt
connect( mActionSelectedToTop, &QAction::toggled, this, [this]( bool checked ) { mDualView->setSelectedOnTop( checked ); } );
connect( mActionZoomMapToSelectedRows, &QAction::triggered, this, &QgsFeatureSelectionDlg::mActionZoomMapToSelectedRows_triggered );
connect( mActionPanMapToSelectedRows, &QAction::triggered, this, &QgsFeatureSelectionDlg::mActionPanMapToSelectedRows_triggered );

connect( mDualView, &QgsDualView::filterExpressionSet, this, &QgsFeatureSelectionDlg::setFilterExpression );
connect( mDualView, &QgsDualView::formModeChanged, this, &QgsFeatureSelectionDlg::viewModeChanged );
}

void QgsFeatureSelectionDlg::keyPressEvent( QKeyEvent *evt )
@@ -128,3 +131,13 @@ void QgsFeatureSelectionDlg::mActionPanMapToSelectedRows_triggered()
{
mContext.mapCanvas()->panToSelected( mVectorLayer );
}

void QgsFeatureSelectionDlg::setFilterExpression( const QString &filter, QgsAttributeForm::FilterType type )
{
mFeatureFilterWidget->setFilterExpression( filter, type, true );
}

void QgsFeatureSelectionDlg::viewModeChanged( QgsAttributeEditorContext::Mode mode )
{
mActionSearchForm->setChecked( mode == QgsAttributeEditorContext::SearchMode );
}
@@ -105,6 +105,16 @@ class GUI_EXPORT QgsFeatureSelectionDlg : public QDialog, private Ui::QgsFeature
*/
void mActionExpressionSelect_triggered();

/**
* Set form filter expression
*/
void setFilterExpression( const QString &filter, QgsAttributeForm::FilterType type );

/**
* View mode has changed
*/
void viewModeChanged( QgsAttributeEditorContext::Mode mode );

private:

QgsVectorLayerSelectionManager *mFeatureSelection = nullptr;

0 comments on commit bcd401d

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