[Qt-interest] How associate slot sender with my data object?
Thomas Dähling
t.daehling at googlemail.com
Sat Jun 20 20:02:59 CEST 2009
I take it you are looking for QObject::sender()
(http://doc.trolltech.com/4.5/qobject.html#sender) ?
Am 20.06.2009, 17:47 Uhr, schrieb Ed Sutton <ESutton at fescorp.com>:
> I am getting started using signals and slots. I use QSignalMapper with
> QGroupBox collection of QRadioButtons that select video channels.
>
> In the received slot, how can I both retrieve the sender's checked state
> and associate the sender with it's related channel data object? Do QT
> widgets support a pointer to a void* "tag object"? Some way to
> associate my data object with the signal sender? I tried to make my own
> but cannot seem to derive from QRadioButton.
>
> In order to determine the QRadioButton checked state in the slot, the
> best choice seems to use the SLOT(channelChanged(QWidget*)) signature.
> In order to associate the sender with my data object, must I make my own
> associative map collection? Is this typical or is there a better
> approach?
>
> Thanks in advance for sharing your experience,
>
> -Ed
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list