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

Multiple widgets of same relation #38331

Merged
merged 22 commits into from
Sep 3, 2020
Merged

Conversation

signedav
Copy link
Contributor

The relation editor widget ("cardinality" and "force hide form on add feature") are now configurable in the widget config, means not per relation but per relation editor widget that is created in the drag and drop (like show labels and button visibility).

relationeditorwidget

This is mainly needed for relations to a reference-table providing multiple many-to-many connections. This implementation resolves #37675

Additionally the dialog opened with double click functionality on field- and relation-items is removed since it had no impact anyway. Same for QML/HTML widget in the "Available Widgets" tree.

Backward compatibility notes:

On reading a project configured with older QGIS versions, the config is taken over and written into the new widget configuration. On changing the settings, the config of the first instance of this relation editor widget is written the old way as well. So on reopening on an older QGIS, the new configuration is readable there.

On autogenerated forms you cannot configure relation editor widgets anymore (since QgsAttributeRelationEdit is removed). But if it has been configured in an older QGIS, the attribute form will still read this configuration.

On reading the configuration the old way with editFormConfig().widgetConfig() over the API or third-party-applications with meta objects, this is still possible. On setting it, it will write it into the first instance of the relation editor widget as well.

The "force hide form popup on add feature" is working weird

When I activate the checkbox on one widget (or on one relation) then it's taken over for all the relation editor widgets. This bug (?) has been there before and is not fixed in this PR. I'll plan a follow up for that.

signedav and others added 20 commits August 3, 2020 09:48
…no info stored in the editFormConfig (and if so, then it would lead to issues, since elementDev->name() is not necessarily unique)
…figuration - stored in a QgsAttributeEditorElement
…eSuppressFormPopup state after the widget has been created
…like the displayName what would be the relation-name) to set the relation in the settings
means the force-suppress-popup and nm-rel in the editFormConfig are written according to the first instance of the widget-tree from same type and name for each relation. and on creating the widget it reads first this config and is only overwritten if there are specific widget config available.
show info message for relation and qml/html widget, where to configure it
select the dropped feature
renamed cardinality to nmRelationId since it's not a cardinality - it's the id of the relation connected through the many-to-many cardinality in this relation editor widget
…t it when false) and use more specific function descriptions
… and the force-suppress-popup the legacy way over setWidgetConfig to keep it backwards compatible
@github-actions github-actions bot added this to the 3.16.0 milestone Aug 17, 2020
@nyalldawson
Copy link
Collaborator

Why the move of all the classes from gui to core? I didn't look in depth, but couldn't immediately see a good reason for this change.

@nyalldawson
Copy link
Collaborator

Ignore that, I read the diff wrong!

@stale
Copy link

stale bot commented Sep 2, 2020

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@stale stale bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 2, 2020
@signedav
Copy link
Contributor Author

signedav commented Sep 2, 2020

No stale. @m-kuhn can we finalize that?

@stale stale bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Sep 2, 2020
@signedav signedav merged commit 4b8797d into qgis:master Sep 3, 2020
@zacharlie zacharlie added Changelog Items that are queued to appear in the visual changelog - remove after harvesting ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

n:m relations with multiple end-points
5 participants