[PyKDE] Auto-Connection supported in PyQt4

Andreas Pakulat apaku at gmx.de
Wed Jan 11 13:38:35 GMT 2006


On 11.01.06 03:25:23, Andreas Pakulat wrote:
> is the auto-connection feature of QObject supported with PyQt4? Will it
> be supported in the future?
> 
> I just tried with a function that is called:
> 
> on_removePictureFormat_clicked(self)
> 
> in a widget that uses a ui created with designer and inheriting from
> that ui. So removePictureFormat is in fact a member of the class.
> 
> This doesn't work, i.e. the function is not called when clicking the
> button, thus my question.

I tried to dig a bit into this, it seems there are 2 things missing for
auto-connection to work:

1. The wrapper for QMetaObject needs to expose connectSlotsByName, this
is in qobjectdefs.sip (and qobjectdefs.h in the qt source).

2. pyuic needs to generate something like:
QtCore.QMetaObject.connectSlotsByName(widget) in the setupUi(self,
widget) function.

However I'm not sure it's that simple, because I don't know how PyQt4
wraps all the Meta-Object stuff. That means, maybe a pythonic
implementation for connectSlotsByName needs to be provided.

Phil can you comment on this, if it's possible to have auto-connection
at all and if you want to do it? (I can provide a patch for pyuic4 to
generate that one extra line of code).

Andreas

-- 
So you're back... about time...




More information about the PyQt mailing list