<div dir="ltr"><div>ok I found the solution, it was because I use an expression for labeling and I had forgotten to set QgsPalLayerSettings().isExpression to True.<br><br></div>Thanks again for your time.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2018-02-04 14:15 GMT+01:00 Martin Dobias <span dir="ltr"><<a href="mailto:wonder.sk@gmail.com" target="_blank">wonder.sk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Feb 4, 2018 at 1:36 PM, Dominique Lyszczarz <<a href="mailto:domlysz@gmail.com">domlysz@gmail.com</a>> wrote:<br>
><br>
> I have another question : after settings some labeling rules with pyqgis,<br>
> the labels are not displaying but if I just enter the rule settings through<br>
> the gui and directly exit it without changing anything then the labels are<br>
> displayed correctly. Is there any register action needed for each rule that<br>
> I forgot in my code ?<br>
<br>
</span>It is hard to say without seeing a code snippet that I could run<br>
myself. Does it help if you force map refresh (e.g. by moving the map<br>
a bit or zooming in/out)? It is also worth playing with "simple"<br>
labeling in pyqgis first as that might help you understand whether it<br>
is just a problem of rule-based labeling or it applies to simple<br>
labeling as well.<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888">Martin<br>
</font></span></blockquote></div><br></div>