2

I know it is possible to associate a layer with a custom UI for editing feature attributes using the QGIS interface by using python:

vectorLayer1.setEditForm('/home/me/uifile.ui')

And I found this to associate the vector layer with python init method:

vectorLayer1.setEditFormInit('moduleName.functionName')

But this only allowed when the module (python file) located in the same directory as my project. Is there any ways to load from external file?

1
  • between, i'm using QGIS 2.18
    – Cy T
    Nov 15, 2016 at 10:09

1 Answer 1

2

I had the same issue, but I found a way to avoid it. I just set the right external file to my Style (.qml) and I do use Layer.setEditForm() and Layer.setEditFormInit() and it works perfectly!

1
  • Cy T does anything worked out for you ? if yes can you accept the answer or share your experience ? it will be valuable for other. Thanks. Feb 22, 2017 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.