[Qgis-developer] How to stopediting/rollback in a plugin before changing the project-file

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Fri Dec 5 09:10:11 EST 2008


Ok, this looks like a bug to me.
In r9743 there is a change such that layerWillBeRemoved is also sent from 
QgsMapLayerRegistry::removeAllMapLayers()

Regards,
Marco

On Friday 05 December 2008 14:44:22 bjsvwpfe wrote:
> Hi Martin,
>
> > What about using layerWillBeRemoved signal from QgsMapLayerRegistry?
>
> thanks for your answer. I've already tried layerWillBeRemoved.
> But it seems that after clicking the Discard-Button SIGNAL removedAll() is
> sent by QgsMapLayerRegistry.
> And after this signal all layers in the QgsMapLayerRegistry have been
> deleted. layerWillBeRemoved works very good when I delete one layer but
> when changing the project removedAll() is sent and I get the following
> error: RuntimeError: underlying C/C++ object has been deleted
>
> Any other hints?
>
> Best regards
>
> Michael

-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee


More information about the Qgis-developer mailing list