[Qgis-developer] apply() in saveStyleAs()

Emilio Loi loi at faunalia.it
Fri Apr 12 10:09:27 PDT 2013

Hi, I noticed this statement in QgsVectorLayerProperties::saveStyleAs()

apply(); // make sure the style to save is uptodate

just after the file dialog launch.
So, every time you want to export a style to a file, qgis applies it to the
layer, losing precedent applied style.
But if the statement is removed, qgis simply crashs :) but I didn't managed
why (in QgsRendererRangeV2::symbol() method).
I'm using part of saveStyleAs() (and related) code to create a qml style
and save it into a postgis db.
Is it so important to apply the style before saving it? Is there any way to
save avoiding to apply?


Emilio Loi - loi at faunalia.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130412/21fded84/attachment.html>

More information about the Qgis-developer mailing list