[Qt-interest] How associate slot sender with my data object?
Ed Sutton
ESutton at fescorp.com
Sat Jun 20 20:14:29 CEST 2009
Thank you for your help. ( I apologize for accidentally replying directly )
> I take it you are looking for QObject::sender()
> (http://doc.trolltech.com/4.5/qobject.html#sender) ?
I am not sure I understand.
I can get the sender if I use the SLOT(channelChanged(QWidget*)) signature. How can QObject::sender() be used to associated the sender with my data object?
Forgive for being slow.
-Ed
> > 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