Hello devs,

I am using the QGIS postprocessing interface to add layers to a layer group. 
The layer group is created in processAlgorithm, while the indivdual layers are 
added from postprocessing classses.

The layer group gets created as expected along with the child layers. However 
toggling the individual layers does not repaint the canvas and has no effect. 
Toggling the entire group does work though.

The pseudocode is as follows:

def processAlgorithm(...):
    root = context.project().layerTreeRoot()
    group = root.insertGroup(0, "myGroup")

    self.postp = MyPostProcessor(group)

    layer = QgsVectorLayer(...)
    if layer and self.context.willLoadLayerOnCompletion(layer.id()):
       
self.context.layerToLoadOnCompletionDetails(layer.id()).setPostProcessor(self.postp).

MyPostProcessor is used to basically move the layer to the group.

When the layer group is also created from within the postprocessing class, 
everthing works perfectly.

What am I doing wrong?

Regards,
Tej


_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to