[PyQt] connectSlotsByName and signals emitted by dialogs?

Matti Airas mairas at iki.fi
Thu Aug 7 10:29:19 BST 2008


Hey all,

I'm trying to get the grips on PyQt4 basics. I've been toying with a
simple dialogs, which I have constructed using Qt Designer and then
converted with pyuic4. I can inherit and use the created class with no
problem, but somehow the quite neat connectSlotsByName baffles me: it
doesn't seem to connect to the accepted signal emitted by the dialog.

Here's what I have tried:

    @pyqtSignature("")
    def on_ItemInputDialog_accepted(self):
	[...]

but the function never gets executed. If I connect to the function
manually, it works fine:

	self.connect(self, SIGNAL("accepted()"), self.on_ItemInputDialog_accepted)

The connectSlotsByName thingy also works if I try to connect to e.g. the
dialog button box:

    @pyqtSignature("")
    def on_buttonBox_accepted(self):
	[...]

Can anyone relate to this?

Cheers,

ma.




More information about the PyQt mailing list