[Qgis-developer] Detect raster layers which have been deleted

Etienne Trimaille etienne.trimaille at gmail.com
Mon Dec 16 13:00:58 PST 2013


Thanks Gino and Denis for these answers.

For the signal, it's ok. Even if the signal from the vector layer is
better than the signal in the layer registry.

For the order, I didn't see anything interesting in the
QgsLegendInterface : http://qgis.org/api/classQgsLegendInterface.html

Regards,
Etienne

2013/12/16 Denis Rouzaud <denis.rouzaud at gmail.com>:
> Hi Etienne,
>
>
> On 14. 12. 13 16:38, Etienne Trimaille wrote:
>>
>> Hi,
>>
>> Sorry, I'm a beginner in pyqgis.
>> I found the signal "layerDeleted ()" in the QgsVectorLayer class,
>> however, I can't find it in the QgsRasterLayer class :
>>
>>
>> http://qgis.org/api/2.0/classQgsVectorLayer.html#acc3e594b1dac4815dc031a2236f66a96
>>
>> Is there a reason ?
>
> I don't know why there is no equivalent for raster layers.
>
>> How can I detect that a raster layer has been deleted ?
>
> But to solve your problem, you can use layer(s)Removed signals in the layer
> registry.
>
> you would use:
>
> QgsMapLayerRegistry.instance().layer(s)Removed.connect(this, yourSlot)
>
> Then in your slot, check if the delete layer(s) is the good one.
>
>>
>> Another question :
>> I didn't find a way to insert a layer at the bottom, not on the top.
>> I want to change the drawing order for a new layer.
>
> Sorry, I had a quick look, and couldn't find how to do this.
> Have to wait for someone else to answer!
>
> Cheers,
>
> Denis
>
>
>>
>> Thanks
>> Regards,
>> Etienne
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>


More information about the Qgis-developer mailing list