[Qgis-developer] Simple sample code for function editor

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Mon Mar 9 08:30:48 PDT 2015


On Mon, Mar 9, 2015 at 2:19 PM, Larissa Junek <junek at gbd-consult.de> wrote:
> Hello all,
> I'm writing a new chapter about the new function editor for the user
> manual 2.8. I'm not confirmed with PYthon programmming.
> See
> http://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/field_calculator.html#function-editor-tab
>
> Is there somebody who can give a short example of code for beginners?
> I look for a code that shows the new possibilities of the function
> editor in comparison to the Python console. On Nathan Woodrows blog
> it is mentioned that it's a possibility to use full Python Code.
>
> It would be great if the description includes an explanation of the
> elements of the code.

Someone recently asked on gis.stackexchange.com how to put the Project
Title into a field in a Map Composer text label. So I wrote an answer:

http://gis.stackexchange.com/questions/137933/how-to-insert-qgis-project-properties-project-title-as-field-or-token-using-an

 That's a fairly minimal example, it just uses one QGIS Python API
call to get the project title. I don't think you can get it into a
label in any other way.

 I'm sure someone can improve it to get rid of the dummy argument. I
should read the documentation...

Barry



> Thanks!
>
> Kind regards,
> Larissa
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list