[QGIS-Developer] pyqtSlot decoration problems with layerChanged in Python 3.10

Xavier C. Llano xavier.corredor.llano at gmail.com
Tue Jan 4 09:11:32 PST 2022


Hi everyone!

I've developed some Qgis plugins, everything was fine until I updated 
Python to 3.10 version, some of these plugins have problems with the 
/pyqtSlot/ with the function /layerChanged/, an example code:

    self.myLayerComboBox.layerChanged.connect(self.myConnectMethod)
    @pyqtSlot(QgsMapLayer) def myConnectMethod(self, layer)     ...

The error is:

    TypeError: decorated slot has no signature compatible with
    layerChanged(QgsMapLayer*)

My question is: if that is a Qgis bug? or that pyqtSlot no longer 
necessary? or has the syntax changed for that decorator?

That error don't happen with Python < 3.10. Using Qgis 3.22.2 on Archlinux.

Thanks!

Xavier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220104/e216bba4/attachment-0001.html>


More information about the QGIS-Developer mailing list