PDA

View Full Version : [SOLVED] Question about signals sources.



hickscorp
8th December 2006, 13:09
Hello again :)

I have a question wich is not a problem for me, i just want to know in advance if i can do it:
Is it possible to get, from a signal, the "originator" of the signal?
For instance, writing a class wich 10 buttons, only one slot to handle all of the 10 different signals (Connect will occurs 10 times, but always with the same slot), and then in this method a simple switch on the originator's adress compared to the adresses of the known 10 buttons?

Thanks!
Pierre.

P.S.: I know i'm asking quite a lot of questions since i suscribed here, well the point is i'm discovering QT (Began 4 days ago) and i really want an overview of it before putting myself into troubles on later code writing :)

lauranger
8th December 2006, 13:18
Hi

QObject::sender() should help you. Along with its recommandations in the doc.

Hth

jacek
8th December 2006, 13:43
Also try QSignalMapper.

hickscorp
8th December 2006, 13:58
Thanks a lot, i'll take a look at those as soon as possible :)

Pierre.

jpn
8th December 2006, 14:04
For buttons and actions there is also QButtonGroup and QActionGroup, respectively..