Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter for Relation Editor LinkFeatureDialog #58185

Closed
signedav opened this issue Jul 19, 2024 · 1 comment · Fixed by #58448
Closed

Filter for Relation Editor LinkFeatureDialog #58185

signedav opened this issue Jul 19, 2024 · 1 comment · Fixed by #58448

Comments

@signedav
Copy link
Contributor

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

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:

image

But this filter I always have to set manually. I would like to have something like this:
image

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

image

image

But I believe it would make sense in the core.

Additional context

No response

@signedav
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant