[Qgis-developer] symbolForFeature in Python api?

Richard Duivenvoorde rdmailings at duif.net
Sat Jun 11 15:05:37 EDT 2011


Hi Devs,

for an export plugin it would be handy to get to the symbol of every
feature in a layer.

There is a cpp-api method called 'symbolForFeature':

http://doc.qgis.org
/head/classQgsRenderer.html#e237fcfb16142298caaa27b62dc8614c

but apparently it is not available in the python object of a renderer?

Tried to add it myself by adding a line:
   virtual QgsSymbol* symbolForFeature( QgsFeature *f );
to
   python/core/qgsrenderer.sip

but that isn't working

-1- is there a reason to NOT add the symbolForFeature to the python api?
-2- what do I have to do to add it (temporarily in my own build)
-3- will there be problems with old and new symbology, if not: please
add :-)

Regards,

Richard Duivenvoorde


More information about the Qgis-developer mailing list