So it seems something related to an old issue https://issues.qgis.org/issues/6573
In effect I've always used old style signals and slots because new style ones always gave me some problems (on Windows). I will have to dig into others' plugins to verify. Anyway it's curious to see that also Processing seems to use a workaround in its PointTool: it emits its own signal instead of using the QgsMapToolEmitPoint.canvasClicked signal. I've done the same to circumvent the issue... But it doesn't apply to all the situations https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/PointMapTool.py Giovanni Il giorno gio 29 nov 2018, 00:39 Nyall Dawson <[email protected]> ha scritto: > On Thu, 29 Nov 2018 at 09:32, G. Allegri <[email protected]> wrote: > > > > During the porting of a plugin to QGIS 3.x I'm facing the following when > using Qgs* objects' signals (it doesn't happen with Qt widgets, etc.). > > I'm using QGIS 3.4 on Window 10. > > > > If I have a Python class like the following: > > > > >class Foo(): > > > def __init__(self): > > > QgsProject.instance().writeProject.connect(self.written) > > > > > > def written(self, dom): > > > (do something) > > > > Hmm - this code works fine for me! > > class Foo(): > def __init__(self): > QgsProject.instance().writeProject.connect(self.written) > > def written(self, dom): > print('bah') > > f=Foo() > > This is on Linux (Fedora). > > Nyall >
_______________________________________________ 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
