[PyQt] New Style emit without subclassing

Demetrius Cassidy dcassidy36 at mass.rr.com
Wed Apr 8 16:12:14 BST 2009

What's wrong with the old signal? It works. I am not sure about the new one 
you are talking about, and haven't really seen any docs on it.

----- Original Message ----- 
From: "Matt Smith" <melkor at orangepalantir.org>
To: <pyqt at riverbankcomputing.com>
Sent: Wednesday, April 08, 2009 7:45 AM
Subject: Re: [PyQt] New Style emit without subclassing

> Thats not quite what I'm getting at.  That will emit the signal, which
> is the 'old style' but the new style is a bit different, and after you
> set it up you emit the signal by using:
> mysignal.emit(args)
> My question is that the only way I know how to make a 'new style' signal
> emittable is via creating a class attribute, ie:
> class MyScene(QtGui.QGraphicsScene):
>    mysignal = QtCore.pyqtSignal(QtGui.QGraphicsSceneMouseEvent)
>    def __init__(self,parent):
>        #normal init stuff
> thanks
> mbs
>> From: "Demetrius Cassidy" <dcassidy36 at mass.rr.com>
>> Subject: Re: [PyQt] New Style emit without subclassing
>> To: <pyqt at riverbankcomputing.com>
>> Message-ID: <285BC363D5E443C4983AF69EEC852F74 at Rahxephon>
>> Content-Type: text/plain; format=flowed; charset="iso-8859-1";
>>         reply-type=original
>> from PyQt4.QtCore import SIGNAL
>> class MyScene(QtGui.QGraphicsScene):
>>    def __init__(self,parent=None):
>>           QtGui.QGraphicsScene.__init__(self,parent)
>> self.emit(SIGNAL(("itemClicked(QGraphicsSceneMouseEvent*)")))
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt 

More information about the PyQt mailing list