[Qgis-developer] QgsAttributeDialog() working example

Salvatore Larosa lrssvtml at gmail.com
Mon Sep 29 12:38:28 PDT 2014


Hi,

On Mon, Sep 29, 2014 at 6:19 PM, Alexandre Neto <senhor.neto at gmail.com> wrote:
> Hello Salvatore,
>
> You were right, I just needed to import the class first, this have opened
> the form for me:
>
>> from qgis.gui import QgsAttributeDialog
>> mc = iface.mapCanvas()
>> layer = mc.currentLayer()
>> temp_feature.setAttributes(attributes)
>> dialog = QgsAttributeDialog(layer, temp_feature, True)
>> dialog.show()
>
>
> But now I can't make it editable.

is your layer editable? you need to call startEditing() method in
order to get the form in edit mode.

Best Regards,
-SL

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode


More information about the Qgis-developer mailing list