[Qgis-developer] Python dynamic forms

Jeremy Palmer JPalmer at linz.govt.nz
Thu Sep 16 03:48:53 EDT 2010


Hi Bernhard,

Thanks for the suggestion. I think I could get that to work. The only problem is my python init script needs to know how to import the MasterPlugin module... So I would have to install the module into a directory in python path. Not ideal in my environment at the moment.

Wouldn't it be nice to just have access to the qgsPluginRegistry via the PyQGIS API?

> How do you access the widgets in the custom ui in your ui-init function?

I access the controls using the findChild method of the QDialog object i.e.

def featureFormInit(dialog, layerid, featureid):
	dialog.findChild(QLineEdit,"myLineEditControl")

It would be a good practice to ensure that each control is defined and available before doing any other stuff in the ui-init stuff.

Cheers,
Jeremy
______________________________________________________________________________________________________

This message contains information, which is confidential and may be subject to legal privilege. 
If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message.
If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message.
LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ.

Thank you.
______________________________________________________________________________________________________


More information about the Qgis-developer mailing list