<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi Alexandre,<br>
<br>
What you did is just the building of the form, you don't have all
the stuff around to make editable/uneditable and update the layer.<br>
<br>
<div class="moz-cite-prefix">If you want to open a feature form like
doing it from QGIS, just run:<br>
<br>
iface.openFeatureForm(layer, feature, false, true/false) <br>
<br>
<a class="moz-txt-link-freetext" href="http://qgis.org/api/classQgisInterface.html#a11b90f38afd09ac5e9f363933ee4a509">http://qgis.org/api/classQgisInterface.html#a11b90f38afd09ac5e9f363933ee4a509</a><br>
<br>
Cheers,<br>
<br>
Denis<br>
<br>
<br>
On 29.09.2014 18:19, Alexandre Neto wrote:<br>
</div>
<blockquote
cite="mid:CA+H0G_EYfe1ch7hS5Y4MqqNAZHQRH3YR6fTDxU39mUnj6_5B2g@mail.gmail.com"
type="cite">
<div dir="ltr">Hello Salvatore,
<div><br>
</div>
<div>You were right, I just needed to import the class first,
this have opened the form for me:</div>
<div><br>
</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">from
qgis.gui import QgsAttributeDialog<br>
mc = iface.mapCanvas()<br>
layer = mc.currentLayer()<br>
temp_feature.setAttributes(attributes)<br>
dialog = QgsAttributeDialog(layer, temp_feature, True)<br>
dialog.show()</blockquote>
</div>
<div><br>
</div>
<div>But now I can't make it editable.</div>
<div><br>
</div>
<div>All I can do is cancel the dialog.</div>
<div><br>
</div>
<div>Thanks for your help,</div>
<div><br>
</div>
<div>Alexandre Neto</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Sep 29, 2014 at 4:21 PM,
Salvatore Larosa <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:lrssvtml@gmail.com"
target="_blank">lrssvtml@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,<br>
<span class=""><br>
On Mon, Sep 29, 2014 at 4:56 PM, Alexandre Neto <<a
moz-do-not-send="true"
href="mailto:senhor.neto@gmail.com">senhor.neto@gmail.com</a>>
wrote:<br>
> Hello,<br>
><br>
> I'm trying to open an attribute dialog for a
temporary feature using<br>
> QgsAttributeDialog(). but with no luck. Can anyone
point me to working<br>
> example?<br>
> I'm trying something like this:<br>
><br>
>><br>
>> mc = iface.mapCanvas()<br>
>> layer = mc.currentLayer()<br>
>> dialog = QgsAttributeDialog(layer, temp_feature)<br>
>> dialog.show()<br>
<br>
</span>I think you should to import the class before and
setting the feature<br>
owner bool parameter.<br>
after this changes the snippet should work fine for you!<br>
<br>
Regards,<br>
-SL<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Salvatore Larosa<br>
linkedIn: <a moz-do-not-send="true"
href="http://linkedin.com/in/larosasalvatore"
target="_blank">http://linkedin.com/in/larosasalvatore</a><br>
twitter: @lrssvt<br>
skype: s.larosa<br>
IRC: lrssvt on freenode<br>
</font></span></blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a></pre>
</blockquote>
<br>
</body>
</html>