RE: connecting signals & slots

From: Fine, Valeri <fine_at_bnl.gov>
Date: Thu, 25 Jan 2007 15:14:46 -0500


Hello Roger,

I think you should elaborate a little bit more where your problem coming from to get an advice.

You mentioned the button object.

That has a few states like "pressed" "clicked" etc, all of those can be reported via Signal / Slot mechanism.

I would like to call your attention the only thing *you* want to know from the button object is how the user has interacted with this button.

The user can do only TWO things with the GUI component like button. He/she either press it or release it. That's all and this *is* signaled. It is up to your code how to respond. At this point your code can *pull* all information it needs. There is no need to pass all parameters through the signal / slot. The only thing you should pass via this channel is the flag that is to notify you about the user intention and whether the information is ready to be fetched. Yes, the code should "know" where the information should be "phishing". Have you problem with the "phishing"? Do you want to pass the object pointer? You can send such pointer from the signal to the slot too. The later is simple and it should be sufficient.  

Best Regards

                         Valeri Fine


Brookhaven National Laboratory
Upton, NY 11973, USA
Phone: +1 631 344 7806
Fax: +1 631 344 4206
E-mail: fine_at_bnl.gov

> -----Original Message-----
> From: owner-roottalk_at_pcroot.cern.ch

[mailto:owner-roottalk_at_pcroot.cern.ch]
> On Behalf Of Roger Mason
> Sent: Thursday, January 25, 2007 2:07 PM
> To: Ilka Antcheva
> Cc: roottalk_at_pcroot.cern.ch
> Subject: Re: [ROOT] connecting signals & slots
>
> Hi Ilka,
>
> Ilka Antcheva <Ilka.Antcheva_at_cern.ch> writes:
>
> > Slot methods can have equal or less parameters then the signal
methods
> > to which they are connected. The order and the type of slot
parameters
> > should follow those in the signal method. You have to find another
way
> > of passing all parameters you need. For an example you may see the
> > code of TFitEditor (the new fit panel interface in ROOT at
> > http://root.cern.ch/root/htmldoc/TFitEditor.html)
>
> Thanks for the help but that looks way too complicated for an amateur
> programmer like me. I'll have to look round for a canned program to
> do my fitting.
>
> Best wishes,
> Roger
Received on Thu Jan 25 2007 - 21:15:57 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 25 2007 - 23:50:00 CET