[PyKDE] Signal + Slots Problem

Sundance sundance at ierne.eu.org
Wed Mar 5 19:11:01 GMT 2003


I heard Stuart Bronk said:

> I have a Widget and a class called Figure I am attempting to connect
> the method Figure.loadQ with the Widgets loadQ method but I cannot
> seem to get it to work
...
>       self.connect(self.Figure, SIGNAL("loadQ()"), self.loadQ())

Okay, two things.

To start with, if Figure is a Python object, then you need to replace
  SIGNAL("loadQ()")
with
  PYSIGNAL("loadQ()")

Also, you're connecting that signal to a *method*, and not to the 
*return value* of that method. Which means you'll need to replace the 
last parameter,
  self.loadQ()
with
  self.loadQ

In short:
  self.connect(self.Figure, PYSIGNAL("loadQ()"), self.loadQ)

HTH. :)

-- S.




More information about the PyQt mailing list