[Qgis-developer] PyQGIS: QgsGraduatedSymbolRenderer class and saveNamedStyle method

Germán Carrillo carrillo.german at gmail.com
Sun Aug 16 19:22:31 EDT 2009


Hi Martin.
Thanks, with this change the qml file is saved.

Regards.

Germán

El 12 de agosto de 2009 03:19, Martin Dobias <wonder.sk at gmail.com> escribió:

> Hi German,
>
> 2009/8/12 Germán Carrillo <carrillo.german at gmail.com>:
> > Hi all. I'm trying to emulate the symbology dialog for a Python
> application
> > but I have a trouble.
> >
> > When I'm working with QgsGraduatedSymbolRenderer and I try to save the
> style
> > to a qml file using the saveNamedStyle() method I get the following
> message:
> >
> > Could not save symbology because:
> >
> > renderer failed to save
> >
> > And in the command line:
> > NotImplementedError: QgsGraduatedSymbolRenderer.writeXML() is abstract
> and
> > must be overridden
> >
> > With the other renderer classes (QgsContinuousColorRenderer,
> > QgsSingleSymbolRenderer, QgsUniqueValueRenderer) the saveNamedStyle()
> > method  works well and the qml file is saved without any problem.
>
> I suspect this might be due missing 'const' classifier in
> QgsGraduatedSymbolRenderer wrapper.
>
> In python/core/qgsgraduatedsymbolrenderer.sip, line 68:
> virtual bool writeXML( QDomNode & layer_node, QDomDocument & document,
> QgsVectorLayer& vl ) const;
> Try to alter "QgsVectorLayer&" to "const QgsVectorLayer&" and
> recompile the bindings.
>
> If it helps, please give me feedback and I'll fix it in SVN.
>
> Martin
>

-- 
-----------
  |\__
(:>__)(
  |/

Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090816/88c73c98/attachment.html


More information about the Qgis-developer mailing list