I have a
QgsVectorLayer and right now I'm retrieving it's fields like that:
for index in layer.attributeList(): print(layer.fields()[index].name(), layer.attributeDisplayName(index))
Now I changed the Attributes Form to "Drag and Drop Designer" defining my own Form Layout.
I need to retrieve the same fields but maintaining the order, which is represented in the QGS project file as
<attributeEditorForm> element. So I'm looking for the index of these
<attributeEditorField> elements, or directly use this list (instead of
attributeList) to get the fields in the order defined in the "Drag and Drop Designer".