[Qt-interest] connect()ing multiple buttons to a receiver
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Wed Jan 7 09:26:28 CET 2009
Paul England wrote on Wednesday, January 07, 2009 6:36 AM:
> ...
> *which* button it points to at that point. I'll check out
> QSignalMapper. I recall using this a while back (vaguely).
QSignalMapper is /indeed/ the thing you're after: When setting it up (connecting the signals from the buttons to the QSignalMapper) it lets you assign unique/meaningful IDs to your buttons. So whenever the QSignalMapper fires its signal (because any button has been clicked) it provides this ID as signal parameter and hence in your slot (which is connected to the QSignalMapper signal) you know *which* button has been pressed :)
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list