[PyKDE] Signal + Slots Problem

Stuart Bronk s.bronk at exeter.ac.uk
Wed Mar 5 18:29:01 GMT 2003


Hi,

I currently trying to set up signals and slots in my application I
understand the principals and have read many examples but I am unable to
get it working on my own could someone possibly help me out :) as this
is only a basic test I am hoping to pass objects later but that is
another step :)

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 

This is the code I am attempting to use in my widget:

def __init__(self,parent,name=None):
    	QGLWidget.__init__(self,parent,name)
	self.Figure = Figure.Figure() # instantiate Figure
      self.connect(self.Figure, SIGNAL("loadQ()"), self.loadQ())

In the Figure class my loadQ method is:

def loadQ():
      QObject.emit("loadQ()")

The interpreter is giving me the following error 
	  File "GLWidget.py", line 27, in __init__
    	     self.connect(self.Figure, SIGNAL("loadQ()"), self.loadQ())
	  TypeError: Argument 1 of QObject.connect() has an invalid type

Any help would be much appreciated :)

Stuart Bronk





More information about the PyQt mailing list