Re: [PyQt] Simple connect error

2010-01-26 Thread Jason H
**facepalm** I had a locally defined class that we overriding it. It was 
missing the slot.




- Original Message 
From: Jason H 
To: Andreas Pakulat ; pyqt@riverbankcomputing.com
Sent: Wed, January 27, 2010 1:22:51 AM
Subject: Re: [PyQt] Simple connect error



- Original Message 
From: Andreas Pakulat 
To: pyqt@riverbankcomputing.com
Sent: Wed, January 27, 2010 1:17:48 AM
Subject: Re: [PyQt] Simple connect error

On 26.01.10 22:05:41, Jason H wrote:
> 
> class Main(QGraphicsView):
> def __init__(self, useGL=False,  parent=None):
> pass
> 
> @pyqtSlot()
> def screenFinished(self):
> print "Main.screenFinished"
> 
> class Screen(QObject):
> finished = pyqtSignal()
> 
> def __init__(self, instanceName, main):
> QObject.__init__(self)
> self.main.screenFinished.connect(self.finished)
> 
> gives me the error: 
> self.main.screenFinished.connect(self.finished)
> AttributeError: 'Main' object has no attribute 'screenFinished'

I'm not too familiar with the new signal/slot mechanism, but a short
read on the docs suggests that your connect is in the wrong order. Its
usually .connect() and you've got it the other way
around.
--

Well the Screen object emits "finished" and I want to connect that to the 
main's screenFinished slot.
self.main.screenfinished is the slot, the self.finished is emitted by the 
screen class. If I reverse it:
self.finished.connect(self.main.screenFinished)
I still get the error.



  

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt



  

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Simple connect error

2010-01-26 Thread Jason H


- Original Message 
From: Andreas Pakulat 
To: pyqt@riverbankcomputing.com
Sent: Wed, January 27, 2010 1:17:48 AM
Subject: Re: [PyQt] Simple connect error

On 26.01.10 22:05:41, Jason H wrote:
> 
> class Main(QGraphicsView):
> def __init__(self, useGL=False,  parent=None):
> pass
> 
> @pyqtSlot()
> def screenFinished(self):
> print "Main.screenFinished"
> 
> class Screen(QObject):
> finished = pyqtSignal()
> 
> def __init__(self, instanceName, main):
> QObject.__init__(self)
> self.main.screenFinished.connect(self.finished)
> 
> gives me the error: 
> self.main.screenFinished.connect(self.finished)
> AttributeError: 'Main' object has no attribute 'screenFinished'

I'm not too familiar with the new signal/slot mechanism, but a short
read on the docs suggests that your connect is in the wrong order. Its
usually .connect() and you've got it the other way
around.
--

Well the Screen object emits "finished" and I want to connect that to the 
main's screenFinished slot.
self.main.screenfinished is the slot, the self.finished is emitted by the 
screen class. If I reverse it:
self.finished.connect(self.main.screenFinished)
I still get the error.



  

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Simple connect error

2010-01-26 Thread Andreas Pakulat
On 26.01.10 22:05:41, Jason H wrote:
> 
> class Main(QGraphicsView):
> def __init__(self, useGL=False,  parent=None):
> pass
> 
> @pyqtSlot()
> def screenFinished(self):
> print "Main.screenFinished"
> 
> class Screen(QObject):
> finished = pyqtSignal()
> 
> def __init__(self, instanceName, main):
> QObject.__init__(self)
> self.main.screenFinished.connect(self.finished)
> 
> gives me the error: 
> self.main.screenFinished.connect(self.finished)
> AttributeError: 'Main' object has no attribute 'screenFinished'

I'm not too familiar with the new signal/slot mechanism, but a short
read on the docs suggests that your connect is in the wrong order. Its
usually .connect() and you've got it the other way
around.

Andreas 

-- 
Your analyst has you mixed up with another patient.  Don't believe a
thing he tells you.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt