[Qgis-developer] PyQGIS: Problems with the layerWasAdded SIGNAL

Martin Dobias wonder.sk at gmail.com
Sun Jun 14 06:22:40 EDT 2009

2009/6/11 Germán Carrillo <carrillo.german at gmail.com>:
> Hi.
> I'm using PyQGIS. I have three classes in my app: Viewer, Legend and Load.
> The Viewer class is the main one, the Load class add some data to canvas.
> The Legend class has a SLOT to capture the layerWasAdded SIGNAL from the
> QgsMapLayerRegistry class and when it happens add an item in a QTreeWidget.
> The Legend class can remove layers. So, I have a problem with the SIGNAL
> layerWasAdded. When I remove a layer I get multiple lines like this:
>   Object::disconnect: Unexpected null parameter
> After that, if I add the same layer again I get a segmentation fault that
> crashes my app.
> This happen even if I use a custom SIGNAL passing the layer object as
> parameter from my Load class.

Hi German,

some code from your app would be helpful. How do you create instances
of the layer classes? How do you delete the layers?


More information about the Qgis-developer mailing list