[Qgis-user] Customised attributes form

Matthias Kuhn matthias.kuhn at gmx.ch
Fri Mar 13 03:36:40 PDT 2015



On 03/13/2015 11:27 AM, emmexx wrote:
> Il 03/13/2015 10:50 AM, Matthias Kuhn scrisse:
>> Is this enough information or is there anything in particular where you
>> need more?
>
> What I'm failing to understand is how qgis can distinguish between a
> standard widget and a customised one.
> Let's say I want to add to my interface a standard qt widget and a
> customised one. I mean a standard QLineEdit and a non standard one.
> How can qgis automagically use my custom code only on the customised one?
> Should I check the name of the widget or some othe property?

Once you have registered your custom widget it will appear in the list
of available widgets in "Layer Properties" > Fields.
QGIS will then be able to connect it to a particular (QTreeWidget)
widget on a .ui form by the field name and the object name of the widget
on the form.
This widget will then be passed to your python code where you will be
able to modify the widget and read its properties to interface with QGIS.

Hope it's clearer now,
Matthias




More information about the Qgis-user mailing list