Our current way of handling read-only layers is not nice.
If a layer is identifiable, but read-only we allow users to preview the feature form. This is ok, but we also allow them to hit edit and change the values of fields.
When a user clicks on save in the form, nothing happens - not even a message. Console prints:
QGIS Input: Warning: Cannot start editing
When a user tries to delete the feature, we show a generic error window saying "this should not happen normally". In this case the console says:
"2023-10-23T09:36:32.563Z QGIS Input: Warning: Cannot start editing\n"
"2023-10-23T09:36:32.563Z CommitChanges: Failed to commit changes:\nERROR: layer not editable\n"
"2023-10-23T09:36:32.564Z QGIS Input: Warning: Cannot delete feature\n"
Expected behaviour
We need to hide the edit button for features in read-only layers
To consider: how about relations? If the parent layer is read-only, shall we allow hitting the "add" button to add a child feature if the linked layer is editable?
Our current way of handling read-only layers is not nice.
If a layer is
identifiable, butread-onlywe allow users to preview the feature form. This is ok, but we also allow them to hiteditand change the values of fields.When a user clicks on
savein the form, nothing happens - not even a message. Console prints:When a user tries to delete the feature, we show a generic error window saying "this should not happen normally". In this case the console says:
Expected behaviour
We need to hide the
editbutton for features in read-only layersTo consider: how about relations? If the parent layer is read-only, shall we allow hitting the "add" button to add a child feature if the linked layer is editable?