<div dir="auto">So it seems something related to an old issue <a href="https://issues.qgis.org/issues/6573">https://issues.qgis.org/issues/6573</a><div dir="auto"><br></div><div dir="auto">In effect I've always used old style signals and slots because new style ones always gave me some problems (on Windows).</div><div dir="auto"><br></div><div dir="auto">I will have to dig into others' plugins to verify.</div><div dir="auto">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</div><div dir="auto"><a href="https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/PointMapTool.py">https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/PointMapTool.py</a><br></div><div dir="auto"><br></div><div dir="auto">Giovanni </div></div><br><div class="gmail_quote"><div dir="ltr">Il giorno gio 29 nov 2018, 00:39 Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 29 Nov 2018 at 09:32, G. Allegri <<a href="mailto:giohappy@gmail.com" target="_blank" rel="noreferrer">giohappy@gmail.com</a>> wrote:<br>
><br>
> 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.).<br>
> I'm using QGIS 3.4 on Window 10.<br>
><br>
> If I have a Python class like the following:<br>
><br>
> >class Foo():<br>
> >  def __init__(self):<br>
> >    QgsProject.instance().writeProject.connect(self.written)<br>
> ><br>
> >  def written(self, dom):<br>
> >    (do something)<br>
><br>
<br>
Hmm - this code works fine for me!<br>
<br>
class Foo():<br>
  def __init__(self):<br>
    QgsProject.instance().writeProject.connect(self.written)<br>
<br>
  def written(self, dom):<br>
    print('bah')<br>
<br>
f=Foo()<br>
<br>
This is on Linux (Fedora).<br>
<br>
Nyall<br>
</blockquote></div>