Re: communication between different parts of application via signals



On 6/25/06, Joe Van Dyk <joevandyk gmail com> wrote:
Hi,

Say a user clicks a checkbox in a menu that affects three other parts
of the application.  Would a signal be the best way to communicate
that change to the rest of the application?  How would that work?
Would I create a custom signal or slot?  How would the other parts of
the application listen to that signal?  Would I create the slot and
then pass that slot to the other parts of the application (i.e. in a
constructor)?

Sorry for the basic questions, but signals and slots and functors are
still confusing to me.

I'm also a gigantic fan of unit testing -- are signals unit testable?

Historically, I've hooked up a function to the clicked event of the
check box.  And that function calls member functions of the different
objects in the application.  So, signals aren't used for
communication.  But something about that seems smelly.

Joe



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]