<p dir="ltr">Thanks for the info,  Matthias. I'm using the development version of QGIS for the relations support.  Looking forward to future updates! </p>
<p dir="ltr">Eric</p>
<div class="gmail_quote">On Jan 27, 2014 5:40 PM, "Matthias Kuhn" <<a href="mailto:matthias.kuhn@gmx.ch">matthias.kuhn@gmx.ch</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Eric,<br>
<br>
On Mon 27 Jan 2014 20:21:35 CET, Eric Goddard wrote:<br>
> Hi all,<br>
> And this is where I'm stuck. I can't find anything in the API docs<br>
> about how to set the value-description pairs. Any help would be<br>
> greatly appreciated!<br>
><br>
> Thanks,<br>
> Eric<br>
><br>
<br>
This was working in 1.8, but it's not working in 2.x releases (so far).<br>
You may have heard of the update to "SIP API v2". Since we did this, Qt<br>
objects are converted to python objects to make it more natural to use<br>
for developers. Before that, you could just retrieve the existing<br>
valuemap and edit it in place, because when you called<br>
layer.valueMap(idx), you would receive a reference to the map QGIS<br>
internally works with. However, the new SIP API converts the map you<br>
receive to a native python dict and creates a copy of it. And if you<br>
edit this copy, QGIS doesn't realize, that there are changes.<br>
<br>
So, in short: If you use 1.8, just edit the map you get back. If you<br>
use 2.0, I don't think there is a possibility and there won't be one in<br>
2.2. However, for 2.4 there will be an update which will make this<br>
possible again (with a new API).<br>
<br>
Regards<br>
Matthias<br>
</blockquote></div>