[PyKDE] Pythons slots? how?

Burley, Brent Brent.Burley at disney.com
Wed Sep 4 00:37:00 BST 2002


Frederick Polgardy Jr wrote:
> 
> >         self.insertItem('apple', self, self.apple)
> >         self.insertItem('orange', self, self.orange)

I had tried that too, and it didn't work.

> I'm sorry, I mean:
> 
>         self.insertItem('apple', self.apple)
>         self.insertItem('orange', self.orange)

Yes, that works, thanks!  Not sure why I didn't try it except that the Qt (C++) documentation had me thinking I needed separate arguments for the object and the slot.  QObject.connect is specifically overloaded and documented to accept a python method, but I didn't generalize from the PyQt
documentation that a python method can be used anywhere a qt slot is used.

In any case, I'm glad it works, and I'm glad I asked!

Thanks,

	Brent




More information about the PyQt mailing list