[Kde-bindings] How to get the sender object in a SLOT in Qyoto?

Arno Rehn arno at arnorehn.de
Fri May 1 08:30:03 UTC 2009


On Friday 01 May 2009 00:33:07 vronskij wrote:
> Hi,
>
> I have two buttons in the window. Both are plugged to the same method.
> How do I tell between them?
> For example, I would like to print the text of the button, that was
> clicked.
>
> None of the signals of the QPushButton or the QAbstractButton do send
> a button object or similar.
>
> In the QtJambi binding (Java + Qt), it is done in the following way:
>
> QPushButton sender = (QPushButton) QSignalEmitter.signalSender();
>
> How do I get a reference to the signal sender?
QObject.Sender()

The API is nearly a 1:1 mapping of the original Qt API, so you can just look 
it up in the Qt docs.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list