[Qgis-developer] segmentation fault in plugin using zoom tool
Radim Blazek
radim.blazek at gmail.com
Fri Oct 6 06:06:54 EDT 2006
On 10/5/06, Martin Dobias <wonder.sk at gmail.com> wrote:
> On 10/5/06, Radim Blazek <radim.blazek at gmail.com> wrote:
> > Note that I added also
> > QgsMapCanvas::unsetMapTool(QgsMapTool* mapTool)
> > to delete current tool if it matches the passed one
> > (or the last non zoom) e.g. when tool has to be stopped from plugin.
> > Maybe a better solution exists? Note that the current tool
> > (last non-zoom) can only be deleted if it is that set previously
> > by plugin.
> >
>
> Hi Radim,
>
> well, probably the way how does it work currently is not really ideal.
> In my previous post (reply to Tim) I've suggested another possibility,
> hopefully easier to comprehend. However now I'm not sure if that won't
> bring any drawbacks.
>
> I see one problem: e.g. GRASS edit has its own set of map tools. The
> question is what to do when grass edit ends - what tool to activate:
> Leave map canvas without any tool? Set panning tool as active? If so,
> how to get the pointer to panning tool to make sure that button
> associated with the tool will be activated?
Yes, plus you must check somehow if another tool was not selected
already, for example:
1) grass - select new point tool
2) qgis - select identify feature tool
3) grass - exit editing
In this situation we dont want to disable 'identify feature tool'
we only have to delete 'grass new point tool' from last non-zoom.
That is the reason I pass pointer to original tool to unsetMapTool
so that current tool is only deleted if it matches the tool previously
set by plugin.
Radim
> Martin
>
More information about the Qgis-developer
mailing list