[QGIS-Developer] Adding Map layer to current project destroy custom layer variables in Qgis3

David Marteau dmarteau at 3liz.com
Wed Jun 20 09:13:51 PDT 2018


Hi

I'm trying to set custom layers variables from processing using  QgsExpressionContextUtils.setLayerVariables to destination layers , I have found that those variables does not appear in 
Qgis. 

I have found that when the layer is inserted in the current project (https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/Postprocessing.py#L81 <https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/Postprocessing.py#L81>) the layer variables are removed - Checking existence of the variable before
and after the call of 'addMaperLayer' shows that layer variables are removed from custom properties.

I cannot tell if this is a bug or not because it seems that the removal may occurs in some signal handler. So if somebody has some clues to where to look, I will be grateful.


Qgis version: 3.0.3-Girona

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180620/618b3e24/attachment.html>


More information about the QGIS-Developer mailing list