New answers tagged

0

For QGIS 3, you have to use: QgsProject.instance().layerTreeRoot().findLayer(layer.id()).setItemVisibilityChecked(False) or to be safe node = QgsProject.instance().layerTreeRoot().findLayer(layer.id()) if node: node.setItemVisibilityChecked(False)


Top 50 recent answers are included