<div dir="ltr"><div>Hi Bernhard,</div><div><br></div><div>Thanks for the link, I guess that the 2.4 problem was already identified and corrected in master.</div><div><br></div><div>A bit of update on this matter. Regarding 2.2. I was doing my tests with a dbf layer. With a postgis table is working well. So I can work with that for now.</div>
<div><br></div><div>Still, it seems that there is something to fix in 2.5. should I open a ticket?</div><div><br></div><div>Alexandre Neto</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 21, 2014 at 12:37 PM, Bernhard Ströbl <span dir="ltr"><<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Alexandre,<br>
<br>
see: <a href="http://hub.qgis.org/issues/10865" target="_blank">http://hub.qgis.org/issues/<u></u>10865</a><br>
<br>
regards<br>
<br>
Bernhard<br>
<br>
Am <a href="tel:21.08.2014%2013" value="+12108201413" target="_blank">21.08.2014 13</a>:23, schrieb Alexandre Neto:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hello all,<br>
<br>
I'm trying to finish a plugin that was initially designed for 1.8.<br>
<br>
Our workflow is currently on QGIS 2.2, but we will update in the future,<br>
so I'm doing some test in 2.4 and in master.<br>
<br>
My goal is to open the feature form of a temporary feature in a layer,<br>
and keep it's attribute values for future actions.<br>
<br>
The code is something like this:<br>
<br>
    mc = iface.mapCanvas()<br>
    layer = mc.currentLayer()<br>
    temp_feature = QgsFeature()<br>
    attributes = []<br>
<br>
    # getting default values (for primary keys)<br>
<br>
    provider = layer.dataProvider()<br>
    for j in layer.<u></u>pendingAllAttributesList():<br>
         if provider.defaultValue(j):<br>
             attributes.append(provider.<u></u>defaultValue(j))<br>
         else:<br>
             attributes.append(None)<br>
    temp_feature.setAttributes(<u></u>attributes)<br>
<br>
<br>
    iface.openFeatureForm(layer, temp_feature)<br>
<br>
    print temp_feature.attributes()<br>
<br>
<br>
My "problems" are:<br>
<br>
In 2.2, after I edit the feature form and press the OK button, the<br>
temp_feature attributes are updated, but so is the first (already<br>
commited) feature of my layer...weird.<br>
<br>
In 2.4, the Feature Form always open in non editng mode, even when the<br>
current layer is editable.<br>
<br>
In master (2.5 1b205be), after pressing the feature form ok button, a<br>
new feature is automaticly added to the attribute table, and the<br>
temporary feature attributes are not updated.<br>
<br></div></div>
I though it might be something to do with *updateFeatureOnly* boolean<div class=""><br>
value, but setting it to True does not seems to make any difference.<br>
<br>
Can anyone of you QGIS developing masters throw some light into my poor<br>
brain?<br>
<br>
Thanks,<br>
<br>
Alexandre Neto<br>
<br>
<br></div>
______________________________<u></u>_________________<br>
<br>
</blockquote>
<br>
<br>
__________ Information from ESET Mail Security, version of virus signature database 10290 (20140821) __________<br>
<br>
The message was checked by ESET Mail Security.<br>
<a href="http://www.eset.com" target="_blank">http://www.eset.com</a><br>
<br>
<br>
______________________________<u></u>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-<u></u>developer</a><br>
</blockquote></div><br></div>