[Qt-interest] retrieve the emitting entity

Donal O'Connor donaloconnor at gmail.com
Mon Apr 27 16:03:19 CEST 2009


If you just want a pointer you could use QObject * sender =
QObject::sender();


On Mon, Apr 27, 2009 at 3:01 PM, Kavindra Palaraja
<kdpalara at trolltech.com>wrote:

> Luca Ferrari wrote:
> > Hi all,
> > is it possible from within a slot having access to the emitting Qt
> object? For
> > instance a pressed button within a slot connected to the clicked()
> signal?
> >
> >
> Correct me if I am wrong, but it seems like you want to know who emitted
> the signal.
>
> Try QSignalMapper:
>
> http://doc.trolltech.com/4.5/qsignalmapper.html
>
> Good luck :)
>
> K.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090427/4eb38707/attachment.html 


More information about the Qt-interest-old mailing list