[PyQt] Strange connexion behaviour

kib2 kib2 at free.fr
Wed Dec 12 23:14:48 GMT 2007


Hi,

in a dialog window I've got the following connexion :

self.bm = publishManager(...)
self.parent.connect(newDoc,QtCore.SIGNAL("triggered()"),self.pm.publish)

where a publishManager class (in another file) has got a publish() 
method depending on the publishManager's publishDir variable.

I was surprised to see that if I change the publishManager's publishDir 
inside my dialog, pm.publish uses the old publishDir value and not the 
new one I gave him in my dialog. Maybe it is byte-compiled at runtime ??

So I've made the following changes :

self.bm = publishManager(...)
self.parent.connect(newDoc,QtCore.SIGNAL("triggered()"),self.publish)

def publish(self):
     self.pm.publish()

And all seems fine ok now.

But I wanted to know why, it took me a lot of time to find it in fact.

Thanks for your hints.

Christophe.


More information about the PyQt mailing list