[PyKDE] Re: qt4 signals and slots

Giovanni Bajo rasky at develer.com
Fri Feb 16 15:36:34 GMT 2007


On 2/16/2007 3:28 PM, Marcos Dione wrote:

 >>> QtCore.QObject.connect( QtCore.SIGNAL("whateveritscalled()"),
 >>> self.yourSlot)
 >> Er, I get a lot of stacktraces over that line because I always 
forget the
 >> first argument to SIGNAL:
 >>
 >> QtCore.QObject.connect( theobjectemittingthesignal,
 >> QtCore.SIGNAL("whateveritscalled()"), self.yourSlot)
 >>
 >> So it's:  (The emitter, the signal, the slot).
 >
 >     I always wondered why it wasn't:
 >
 > emitter.connect (signal, receiver.slot)

Because QObject.connect() is a static method (also in C++).
-- 
Giovanni Bajo




More information about the PyQt mailing list