[Qgis-developer] (very) dynamic (python) forms

Andreas Neumann a.neumann at carto.net
Mon Jan 4 03:02:26 EST 2010


Hi Richard,

Here is more info.

To associate the start-script with the layer do the following:
Layer Properties --> General --> Init function

The python script can reside either in the project directory, side by side
with the .qgs project file, or in the python plugin directory.

In my case the init functions are "haltung.featureFormInit" and
"normschacht.featureFormInit". It receives the following parameters:
dialog,layerid,featureid

I attached you two sample scripts. You can't do much with it without the
database, but you see the structure of the script. Starting from the
featureFormInit method or function you can do pretty much everything you
can do with python scripting.

Hope this helps,
Andreas


On Sun, January 3, 2010 7:49 pm, Andreas Neumann wrote:
> Hi Richard,
>
> In the QGIS 1.4 or the development builds there is the possibility to
> specify an onload python script. This script is called whenever the
> dialogue is opened.
>
> I can send you an example tomorrow and more info from my workplace. I
> don't have it at home. Jürgen Fischer implemented this if you have more
> in-depth questions.
>
> Best,
> Andreas
>
> On Sun, January 3, 2010 1:02 pm, Richard Duivenvoorde wrote:
>> Hi List,
>>
>> I got a question from some fieldworkers to be able to do (point/area)
>> digitizing in the field using qgis and qps on a netbook with
>> touchscreen.
>> I read tim's blog post:
>> http://linfiniti.com/2009/11/creating-dynamic-forms-a-new-feature-headed-for-qgis-1-4/
>>
>> I need a way to hook my own dialog into the edittool, but only using the
>> ui-file is not enough, because I need to fill/layout the dialog with
>> dropdowns according to a certain context.
>>
>> Any ideas, pointers or lines of code to be able to use a truly dynamic
>> scriptable form?
>>
>> For example: where do I hook a python plugin into the edittool(s)?
>>
>> Did other people already do a project like this?
>>
>> Regards,
>>
>> Richard Duivenvoorde
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
>
> --
> Andreas Neumann
> http://www.carto.net/neumann/
> http://www.svgopen.org/
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>


-- 
Andreas Neumann
http://www.carto.net/neumann/
http://www.svgopen.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pythonInitFunction.zip
Type: application/zip
Size: 12610 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100104/fcf1425d/pythonInitFunction-0001.zip


More information about the Qgis-developer mailing list