I have made a custom form with a QgsRelationEditorWidget and with a QToolButton. I want to select a feature in this QgsRelationEditorWidget and press the button to open another form with this selected feature. For it, I need to get this selected feature attributes. The code is a py file.
I think I have to access to the QgsRelationEditorWidget with this code:
childFormWidget = dialog.findChildren(QgsRelationEditorWidget) childForm = childFormWidget.findChildren(QgsRelationEditorWidget) featureManager = childForm.featureSelectionManager() infraManager.selectionChanged.connect(partial(changeSelection, featureManager))
But I have this error:
IndexError: list index out of range.
Also, I don't know how to access the attributes with featureManager.
How can I do it? How can I reach to the selected feature?