[PyQt] Autoconnecting two signals to the same method.

Andreas Pakulat apaku at gmx.de
Sat Mar 15 09:26:46 GMT 2008


On 15.03.08 09:31:14, Rocco Orlando Rossi wrote:
> Hi all.
> 
> I'm new to PyQt. I'm coming from pygtk and Glade, but I am really very
> interested in trying out PyQt, Eric, and Designer as a more valid
> alternative.
> 
> Now, very briefly, here's my problem. I was attempting to autoconnect  two
> different signals to the same method function, but I quickly realized that
> it isn't at all obvious how to go about doing something like that. I thought
> the decorator pyqtSignature might do the trick, but unfortunately chaining
> those decorators did not work.
> 
> Any ideas?

The simple answer is: You can't. That is you can't do this via the
auto-connect feature. That features uses the method name to find out the
actual signal to use, so on_pushButton_clicked is a slot thats only
called when the clicked signal of "pushButton" is emitted.

You have to write the two connect statements in your __init__.

Andreas

-- 
Your boss climbed the corporate ladder, wrong by wrong.


More information about the PyQt mailing list