[Qgis-developer] [Python] loadNamedStyle

Bernhard Ströbl bernhard.stroebl at jena.de
Wed Sep 4 06:00:12 PDT 2013


Hi,

I am fiddling around with saving layer styles to the database 
(PostgreSQL) in QGIS 1.9.
I succeeded in saving styles for a layer and applying them. The default 
style is applied if I load the layer via Python, too.
My aim is to save several styles for one layer, load the layer via 
Python and apply a certain one of the saved styles to it.

I do not know,
- how to use layer.listStylesInDatabase() as it returns only the amount 
of styles available for layer but neither their ids nor their names or 
description,
- how to use layer.loadNamedStyle() with a style from the database, 
especially how to specify theUri (name or id of the style do not work as 
theUri)

any help or working examples highly appreciated

Bernhard


__________ Information from ESET Mail Security, version of virus signature database 8762 (20130904) __________

The message was checked by ESET Mail Security.
http://www.eset.com




More information about the Qgis-developer mailing list