Closed signedav closed 2 weeks ago
The setting might should happen somewhere here...
https://github.com/qgis/QGIS/blob/master/src/gui/qgsabstractrelationeditorwidget.cpp#L472-L478
... kind of like this ...
selectionDlg->setFilterExpression("relevant_progrtyp_alr = True AND relevant_subregion_1_2 = True",QgsAttributeForm::ReplaceFilter);
... but setFilterExpression of QgsFeatureSelectionDlg needs to be public first.
Feature description
The Relation Editor Widget is a powerful tool to link children objects to a parent object or - with many-to-many relations - directly choose the "other" parent and perform an entry in the join table. There are options like creating child objects or linking exiting ones.
The "opposite" of it is the Relation Reference Widget, where we choose the parent object. There a useful feature is the filter.
But in Relation Editor Widget we still need to filter manually when we filter objects.
So this would be a very useful feature.
Example
We do have a layer representing fields named "Beurteilung_Wiese" with a parameter "uzl_subregion" what could be "1.1", "1.2", "1.3", depending where the field is:![image](https://github.com/user-attachments/assets/d65fb4f4-902d-4369-8818-86b74a1ab1ec)
Now we want to link fauna-types to the current "Beurteilung_Wiese", but in the huge list of all the fauna-types we only want to have the ones that really exist in the current subregion. Means I need a filter like this:
But this filter I always have to set manually. I would like to have something like this:![image](https://github.com/user-attachments/assets/3a41ca17-373a-4028-8788-94a601a11510)
There's the QGIS Linking Relation Editor plugin where there is an unfinished prototype branch:
https://github.com/opengisch/qgis-linking-relation-editor/pull/49/files
But I believe it would make sense in the core.
Additional context
No response