Re: [QGIS-Developer] Changing attributes of a newly created feature in Python form init code

2024-01-10 Thread Stefanos Natsis via QGIS-Developer
Hi Hannes This looks like an XY problem case! If your actual goal is to: > Any pointers on how to properly update a new feature's attribute fields, > that exist on a layer but are not shown the user with the QGIS' widgets > in the attribute form? then you simply need to set a Default Value for t

Re: [QGIS-Developer] Changing attributes of a newly created feature in Python form init code

2024-01-10 Thread Frank Broniewski via QGIS-Developer
Hi Hannes, i can unfortunately only confirm that this does not work, one can't seem to be able to set any field value (tried "text" as well). If you have the feature you can usually just do `feature["int"] = 12345` or feature.setAtrtribute("int", 12345), but that does not have any effect on thi

Re: [QGIS-Developer] Changing attributes of a newly created feature in Python form init code

2024-01-10 Thread WhereGroup
Still stumped with this, now cross-posted to https://gis.stackexchange.com/questions/474014/changing-attributes-of-a-newly-created-feature-in-python-form-init-code I noticed that the both the `id(feature)` is always different when I look at it in either function which suggests the object got co