[PyKDE] Signal getting lost

Jan Ekholm chakie at infa.abo.fi
Mon May 20 10:30:00 BST 2002


Hi all,

I have a small interesting problem with PyQt 2.5. And no, I won't compile
a newer version from source and mess up the nice Debian package I already
have installed.

I've been having a really weird problem with a PYSIGNAL from a class
getting lost, ie. it never reaches the slots to which it is connected.

I have something like this (simplified)

class EmittingClass:
   def foo:
      self.emit ( PYSIGNAL('fooSignal'), (a,b,c,d))

   def bar:
      # this signal is emitted ok
      self.emit ( PYSIGNAL('barSignal'), (a,b))

class TargetClass:
   def __init__:
      self.ec = EmittingClass()

      self.connect ( self.ec, PYSIGNAL('fooSignal'), self.fooSlot)
      self.connect ( self.ec, PYSIGNAL('barSignal'), self.barSlot)

   def fooSlot (self, a,b,c,d):
      # this one is called ok
      pass

   def barSlot (self, a,b):
      # this one is never ever called
      pass

The problem is that although the EmittingClass emits barSignal it newer
makes it to the slot to which it's connected. The emit() call is
definitely executed. The same class emits a number of other (similar, only
name differs) signals, and they work just fine. I've tried changing the
name of the signal and slot, but no difference. I get no runtime error
either.

Were there any serious bugs related to handling PSIGNAL:s in 2.5? Should I
just put this project on ice and wait for 3.x to make its way to Debian?

-- 
    - "Remember -- that which does not kill us can only make us stronger."
    - "And that which does kill us leaves us dead!"
                                           -- Terry Pratchett, Carpe Jugulum




More information about the PyQt mailing list