[Qgis-developer] How to access "Add New Feature" QgsRubberband methods?

Alexandre Neto senhor.neto at gmail.com
Sun Mar 27 07:42:35 PDT 2016


Hi matthias,

I thought about that as well, but was unsure about what would be the best
approach. Since the rubberband approach is not available I will try the
backspace event then.

Thanks!!

Matthias Kuhn <matthias at opengis.ch> escreveu no dia domingo, 27/03/2016 às
15:12:

> Hi Alexandre,
>
> The rubberband belongs to the internals of the maptool. As long as you
> don't want to subclass the maptool I think the easiest way is to send the
> backspace event to the maptool instead. And I would even say that this is
> semantically the correct thing to do.
>
> Matthias
>
>
> On 03/27/2016 04:06 PM, Alexandre Neto wrote:
>
> Hello all,
>
> Can anyone tell me how can I, using Python, access to the "Add New
> Feature" QgsRubberBand methods? Or maybe point me to same sample code?
>
> I don't want to create a new rubberband, I would like to access the one
> that is created by the drawing/editing maptools.
>
> I can reach the current mapTool with,
>
> iface.mapCanvas().mapTool()
>
> But I'm not understanding how to from there
>
> I wanted to use removeLastPoint() (or the undo() in ). The idea is to
> simulate the backspace key functionality with a button to use in a tablet
> device (Windows).
>
> Thanks,
>
> Alexandre Neto
> --
> Alexandre Neto
> ---------------------
> @AlexNetoGeo
> http://sigsemgrilhetas.wordpress.com
> http://gisunchained.wordpress.com
>
>
> _______________________________________________
> Qgis-developer mailing listQgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> --
> Matthias Kuhn
> OPENGIS.ch - https://www.opengis.ch
> Spatial • (Q)GIS • PostGIS • Open Source
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://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/20160327/3bac6b89/attachment.html>


More information about the Qgis-developer mailing list