<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 21, 2014 at 12:45 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">I tried in master (1.5) after Jürgen's fix and it worked for me (PostGIS I think)<br>
<br>
Bernhard<br>
<br></blockquote><div><br></div><div>In QGIS 2.5 the problem is different. Opening and editing a new feature form with openFeatureform(temp_feature) automatically adds it to the layer, and does not update the temp_feature attributes after you press ok.</div>
<div><br></div><div>I believe that the original behavior were to update the temp_feature attributes and then you would need to manually add the feature to the layer with layer.addFeature(temp_feature), this would allow some feature manipulation between the processes.</div>
<div><br></div><div>Alexandre</div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am <a href="tel:21.08.2014%2013" value="+12108201413" target="_blank">21.08.2014 13</a>:41, schrieb Alexandre Neto:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
Hi Bernhard,<br>
<br>
Thanks for the link, I guess that the 2.4 problem was already identified<br>
and corrected in master.<br>
<br>
A bit of update on this matter. Regarding 2.2. I was doing my tests with<br>
a dbf layer. With a postgis table is working well. So I can work with<br>
that for now.<br>
<br>
Still, it seems that there is something to fix in 2.5. should I open a<br>
ticket?<br>
<br>
Alexandre Neto<br>
<br>
<br>
On Thu, Aug 21, 2014 at 12:37 PM, Bernhard Ströbl<br></div><div class="">
<<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a> <mailto:<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.<u></u>de</a>>> wrote:<br>
<br>
Hi Alexandre,<br>
<br></div>
see: <a href="http://hub.qgis.org/issues/__10865" target="_blank">http://hub.qgis.org/issues/__<u></u>10865</a><br>
<<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> <tel:21.08.2014%2013>:23, schrieb Alexandre Neto:<div class=""><br>
<br>
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<br>
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<br>
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></div>
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)<div><div class="h5"><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<br>
when the<br>
current layer is editable.<br>
<br>
In master (2.5 1b205be), after pressing the feature form ok<br>
button, a<br>
new feature is automaticly added to the attribute table, and the<br>
temporary feature attributes are not updated.<br>
<br>
I though it might be something to do with *updateFeatureOnly*<br>
boolean<br>
<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<br>
my poor<br>
brain?<br>
<br>
Thanks,<br>
<br>
Alexandre Neto<br>
<br>
<br>
______________________________<u></u>___________________<br>
<br>
<br>
<br>
__________ Information from ESET Mail Security, version of virus<br>
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></div></div>
______________________________<u></u>___________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a> <mailto:<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.<u></u>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>
<<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>
<br>
<br>
</blockquote><div class="HOEnZb"><div class="h5">
<br>
<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>
</div></div></blockquote></div><br></div></div>