[PyKDE] "sender" info in Python slot

Sibylle Koczian Sibylle.Koczian at T-Online.de
Thu Nov 9 16:43:00 GMT 2006


Hello,

hopefully the subject line isn't too misleading. This is my problem: I would like to connect the "clicked" signal of several buttons to one and the same function - but this function should know which button sent the signal. Example: one button to increase a value, another to decrease it, and one single function which adds '+1' or '-1' depending on the sending button. Or a row of buttons with a letter, and clicking one searches for all words beginning with this letter in a list.

How can I do this? Subclassing QPushButton seems to be a possibility, but is there a simpler way?

Using PyQt 4 with Python 2.4.

Thank you,
Koczian

-- 
Dr. Sibylle Koczian 
Fasanenstrasse 12 
D-82293 Mittelstetten 




More information about the PyQt mailing list