<div dir="ltr">Hi Martin,<div><br></div><div>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.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 12, 2016 at 7:57 PM, Martin Dobias <span dir="ltr"><<a href="mailto:wonder.sk@gmail.com" target="_blank">wonder.sk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Akbar<br>
<span class=""><br>
On Tue, Jul 12, 2016 at 7:49 PM, Akbar Gumbira <<a href="mailto:akbargumbira@gmail.com">akbargumbira@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I am trying to add symbols/colorramps through Python API and I have a<br>
> problem that after adding symbol/colorramps, the added symbols/colorramps<br>
> don't show up in Style Manager right away. The symbols are added in the<br>
> symbology-ng-style.db, but the added symbols show up once I restart QGIS<br>
<br>
</span>Try this instead:<br>
<br>
style = QgsStyleV2.defaultStyle()<br>
style.addSymbol("ABC", my_symbol)<br>
<br>
The default style is the one loaded on start and used throughout QGIS<br>
application, so if you modify it, the changes will be immediately<br>
visible in the GUI and will be saved automatically.<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888">Martin<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><p><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-------------------</span></b></p><b>Akbar Gumbira </b></div><div><b style="font-size:12.8px"><a href="http://www.akbargumbira.com" target="_blank">www.akbargumbira.com</a></b></div></div></div></div></div>
</div>