Is there a way to add a new field column to a vectorlayer's features in qfield's plugin?

Basically, I want to add a new field in a loaded project’s layer and the features in it.

I’ve found out that in QGIS’s QgsFields class, an “append” function is supported, but unfortunately it is not a QML callable function although the QgsFields class is registered as a meta type by qfield in its plugin system.

Is now there in qfield v3.5.0 any way to realize it?

Or if it is not possible now in v3.5.0, will there be a new API in qfield’s FeatureUtils singleton for wrapping this QgsFields::append() function to expose this capability for in-plugin usage in the future?

Thanks for any discussion and reply in advance.


Imported from GitHub discussion by @gitpydev on 2025-03-01T07:55:18Z

gitpydev , greetings – it is not possible ATM to modify (i.e. rename/add/remove) vector layers’ fields. We could make relevant QgsVectorLayer functions Q_INOKABLE to achieve that if needed.


Imported from GitHub comment by @nirvn on 2025-03-08T10:58:34Z