Hi Martin,

Thanks, seems to work. I read a bit the cpp code in Style Manager DIalog
that it will load the default style when showing up the dialog. So I
thought once it's written correctly to the database, it will not have this
problem. Thanks for the explanation, it's clear now what the API's are
meant to do.

On Tue, Jul 12, 2016 at 7:57 PM, Martin Dobias <wonder...@gmail.com> wrote:

> Hi Akbar
>
> On Tue, Jul 12, 2016 at 7:49 PM, Akbar Gumbira <akbargumb...@gmail.com>
> wrote:
> > Hi,
> >
> > I am trying to add symbols/colorramps through Python API and I have a
> > problem that after adding symbol/colorramps, the added symbols/colorramps
> > don't show up in Style Manager right away. The symbols are added in the
> > symbology-ng-style.db, but the added symbols show up once I restart QGIS
>
> Try this instead:
>
> style = QgsStyleV2.defaultStyle()
> style.addSymbol("ABC", my_symbol)
>
> The default style is the one loaded on start and used throughout QGIS
> application, so if you modify it, the changes will be immediately
> visible in the GUI and will be saved automatically.
>
> Cheers
> Martin
>



-- 

*-------------------*
*Akbar Gumbira *
*www.akbargumbira.com <http://www.akbargumbira.com>*
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to