[PyKDE] connectSlotsByName do that really works in python?

Andreas Pakulat apaku at gmx.de
Wed Dec 13 12:44:42 GMT 2006


On 13.12.06 06:17:32, Miguel Angel Cañedo wrote:
> I have been reading about the new auto connect  of Qt, I have been trying to 
> get it workin with no success....

:( Works over here.

> Is there a specific way or place to declare th functions?

You should make sure the slots are not "ambigious" in the number of
parameters they take. For example the QPushButton::clicked() signal
comes in 2 forms, one with a parameter, one without. For these you have
to decorate the slot with the information about the signal, see:

http://www.riverbankcomputing.com/Docs/PyQt4/pyqt4ref.html#the-qtcore-pyqtsignature-decorator

how to do that.

> What am i missiing?

Huh? Thats not "the right way", you do not write code into the generated
files, you create a new subclass from QWidget (or QDialog, QMainWindow)
and the Ui_Dialog and then in __init__() you call self.setupUi(self).

connectSlotsByName traverses the slots of "self" to find those that
match a given object-signal combination.

Andreas

-- 
Be careful!  Is it classified?




More information about the PyQt mailing list