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

Reply via email to