Hi Jörg,
The easiest way is to set it up manually and inspect what the API returns.
>>> iface.activeLayer().editorWidgetSetup(1).type()
'ValueRelation'
>>> iface.activeLayer().editorWidgetSetup(1).config()
{'AllowMulti': False, 'AllowNull': False, 'FilterExpression': '', 'Key':
'fid', 'Layer': 'countries_9ed4f4a4_f300_4bd3_a496_4b5fab68fc01',
'LayerName': 'countries', 'LayerProviderName': 'ogr', 'LayerSource':
'countries.gpkg', 'NofColumns': 1, 'OrderByValue': False,
'UseCompleter': False, 'Value': 'test'}
>>> iface.activeLayer().setEditorWidgetSetup(1,
QgsEditorWidgetSetup('TextEdit', {} ))
Hope that helps
BR
Matthias
On 7/26/19 10:45 AM, Prof. Dr. Jörg Höttges wrote:
Hi all,
in a QGIS3 plugin I need to modify the editwidget from "TextEdit" to
e. g. "ValueRelation". How can I find out the Widgetname that I need
for editFormConfig.widgetConfig(widgetname)? Or is this the wrong way
to do it?
Thanks in advance
Jörg
FH Aachen
Prof. Dr.-Ing. Jörg Höttges
Fachbereich 2 - Bauingenieurwesen
Wasserwirtschaft und Bauinformatik
Raum 02315
FH Aachen
University of Applied Sciences
Bayernallee 9
52066 Aachen | Germany
T +49 (0)241 6009-51176
F +49 (0)241 6009-51206
http://www.fh-aachen.de/hoettges/
[email protected] <mailto:[email protected]>
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer