QgsProject.readProject I add a slot to some layer's
selectionChanged. I tried disconnecting these slots in
QgsProject.layersWillBeRemoved but here the project seems already closed, so I can't retrieve the layers to disconnect the slots.
There is a secont signature
layersWillBeRemoved(self, layers: Iterable[QgsMapLayer]) but I failed to connect to it.
@pyqtSlot(list) def layersWillBeRemovedHandler(self, layers): #disconnect ... project.layersWillBeRemoved.connect(self.layersWillBeRemovedList) #without [list]
decorated slot has no signature compatible with layersWillBeRemoved(QStringList).
there is no matching overloaded signal whether the handler is decorated or not with
So how do I solve this? Do I need to disconnect them at all, when the project is closed (or the layer is removed from the project)?