[PyKDE] Re: qt4 signals and slots

Dave Fancella dave at davefancella.com
Fri Feb 16 08:55:14 GMT 2007


On Friday 16 February 2007 1:43 am, Ritesh Raj Sarraf wrote:
> In QT4 designer, I don't see a way to add custom slots of my own. All that
> I see is a set of predefined slots. There isn't any option to add a custom
> slot there.

You can't.  And it's probably better that way.  Instead, you need to do it by 
hand, which sounds like more work than it is.  Do something like:

QtCore.QObject.connect( QtCore.SIGNAL("whateveritscalled()"), self.yourSlot)

The only catch is the string you pass to SIGNAL has to match exactly the 
signal's string.  It's a new gotcha because Qt3's designer took care of that 
for you, just remember to take out all spaces and you should be fine.  :)

Dave

> Is there any document which explains about how to add custom slots, in the
> designer, when associating with signals ?
> I really am new to QT/PyQT.
>
> Thanks,
> Ritesh




More information about the PyQt mailing list