Here are the use cases and how the relation editor widget could look in qfield with the different behavior for one-to-many and many-to-many relationships.
The childfeatures are listed. In any case, the delete icons is black *1. This means the child features will be deleted.
By pressing on the feature the "embedded" Form pops up:
By pressing on the + the form for creating a feature appears (same style like "embedded" popup):
The referenced features are listed.
It's always an association, so the delete icons are only blue. This means only the reference (entry in the referencetable) is deleted and the related feature still existing.
Anyway because of the many-to-many cardinality is set, on pressing on the feature the "embedded" form of the related feature (not the referencetableentry) pops up:
By pressing on the + the form for linking a feature pops up:
You can select the feature you want to link in the combobox:
Or by pressing + you can add a new feature. The form for creating a feature pops up:
In case there are attributes on the reference there should be possible to display it with display expressions in the list:
This means in the configuration the cardinality should not be set to many-to-many because we are interested in the referencetable.
Pressing on the feature a form opens where we can set the values of the referencetableentry and selecting another related feature.
On pressing the + the same form opens but a new relation is created on selecting the feature.
By pressing the + the addform opens like we are used to:
On N:M Relations with attributes of reference there could be on editing the referencetableentry the possibilty to add a new related feature as well and on adding a new referencetableentry the possibility to edit a related feature as well. So there could be two buttons or another GUI sollution:
By pressing then the edit-icon the editform opens like we are used to:
This approach works well with a small amount (e.g. < 100) of selectable features. If they are more it needs to be more confortable to find it. There are two approach:
- Search function
- List all the selectable features in scrollable list
Both approaches can be imagined like the contacts on usual android:
On 1:N relations in QGIS exist the relation strengths "association" and "composition". The composition should mean, that the child features are depending on the parent -> so get deleted on "unlinking". On association they would still be on their lable.
At the moment, it's implemented like a composition. The child features would be deleted on delete.
In case the relation is an association, the delete icons could be blue as well. This means only the reference is deleted and the child feature still existing.
But composition is anyway prefered. Because otherwise you got "lost" childs.
Instead of the list view there could be a swipe view where QField recognizes an image widget. So the user could swipe between the images and add new ones using the camera or delete one.