[Qgis-developer] API change: map tools

Radim Blazek radim.blazek at gmail.com
Fri Oct 13 07:53:21 EDT 2006


On 10/13/06, Martin Dobias <wonder.sk at gmail.com> wrote:
> Hi,
>
> according to recent debate on qgis-developer list (in thread
> "segmentation fault in plugin using zoom tool"), I've modified the way
> how to work with map tools (in revision 5940).
>
> Till now, after setting QgsMapCanvas::setMapTool() map canvas took
> ownership of the tool and when it was replaced with another tool, it
> got deleted. This showed to be a bit problematic.
>
> New way of using map tools is that caller must save the pointer to the
> map tool. When you call setMapTool(), the old tool gets deactivated
> and new tool gets activated and set as current. Later, tool has to be
> deleted by the owner. There's no problem to delete a tool while it's
> being still used as QgsMapTool constructor calls
> QgsMapCanvas::unsetMapTool which stops to use that tool if it's active
> (or saved as last non-zoom tool).
>
> I hope that it won't introduce any new problems, but if so, let me know.

Are you going to change also GRASS plugin?

Radim

> Martin
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.qgis.org
> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>



More information about the Qgis-developer mailing list