[QGIS-Developer] How to call add feature attributes dialog from a plugin

C Hamilton adenaculture at gmail.com
Mon Nov 20 06:59:58 PST 2017


Thank you. That was exactly what I was looking for.

On Fri, Nov 17, 2017 at 7:10 PM, Alexandre Neto <senhor.neto at gmail.com>
wrote:

> openFeatureForm() is what you are looking for:
>
> http://doc.qgis.org/api/2.18/classQgisInterface.html#
> a11b90f38afd09ac5e9f363933ee4a509
>
> C Hamilton <adenaculture at gmail.com> escreveu no dia sexta, 17/11/2017 às
> 17:02:
>
>> When a points vector layer is enabled for editing, and the "Add Feature"
>> tool is selected, when you click on the map you get a popup dialog ("Points
>> - Feature Attributes") that allows you to enter the vector layer attributes.
>>
>> Is it possible to programmatically access this dialog from a plugin that
>> is going to add a point to the map, but would like an attribute dialog to
>> pop up for entering the attributes? I would rather make use of the existing
>> function and not reinvent it.
>>
>> Is there a difference between these two functions when adding a feature
>> to a vector layer other than the first adds a single feature and the second
>> can add multiple features?
>>
>> layer.addFeature(feature)
>> layer.dataProvider().addFeatures([feature])
>>
>>
>> Thanks,
>>
>> Calvin
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> --
> Alexandre Neto
> ---------------------
> @AlexNetoGeo
> http://sigsemgrilhetas.wordpress.com
> http://gisunchained.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171120/2960329e/attachment.html>


More information about the QGIS-Developer mailing list