Maybe I've misunderstood, but are you trying to define a new function to appear as an expression? Isn't that what the @qgsfunction decorator does? Do you need to define a new class for this?
http://nathanw.net/2015/01/19/function-editor-for-qgis-expressions/ On Thu, Sep 3, 2015 at 4:12 PM, Hugo Mercier <[email protected]> wrote: > Hi, > > I am using custom expressions functions for a plugin. > Something like this : > > class MyFunction( QgsExpression.Function ): > def func( self, values, feature, parent ): > feature.geometry() > ... > > The problem is that "feature" is now a QgsExpressionContext(), not a > QgsFeature anymore. > I cannot find how to access the feature from the context. Did I miss > something ? > > Thanks > _______________________________________________ > Qgis-developer mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-developer _______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
