mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-17 00:09:36 -04:00
Merge pull request #34336 from troopa81/fix_formfilter_featureselectiondlg
Fix form filtering when used in feature selection dialog
This commit is contained in:
commit
0a9bbd724f
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user