[Qgis-developer] Removing layers in QGIS

Marco Hugentobler marco.hugentobler at autoform.ch
Tue Mar 21 02:49:52 EST 2006


>Ah well, I haven't noticed the latter one (legendLayerRemove) which
>also removes layer from  registry. The incorrect function I have meant
>was QgisApp::removeLayer (it lefts  - I guess that the right approach
>is just to call QgsLegend::legendLayerRemove - is it right?
>
It lefts? That's a bug. I thought that it would call 
QgsLegend::legendLayerRemove.

>I thought a bit on this topic and this looks like good solution: every
>map canvas has it's own legend - for the matter of not getting legend
>implementation too complex. Map layer registry holds also count of
>canvases referencing a layer, therefore when it's going to be removed
>from one legend, it decreases number of references and deletes it when
>counter reaches zero.
>
It depends how we want the multiple canvases to behave. If each canvas 
has its own legend, it is like MDI. If all canvases have the same 
legend, it's like multiple views for the same project. I can think of 
useful situations for both.

Marco




More information about the Qgis-developer mailing list