View Full Version : What if not Signal/Slot

25th May 2006, 17:34

All of us here know how signal/slot makes our life easy. But how can we design our classes without signal/slot and still make them loosely coupled.

Let me give an example :

Let us consider QListWidget which is child of a some widget. This "some" widget is child of a QSplitter which in turn is Child of QMainWindow.

Now, let us assume that there is no Signal/Slot and when user focuses in/out the QListWidget a menu item have to change. In the above situation what should be an ideal design ? How will the classes communicate with each other ?

Thanks a lot for the idea and time.
Thanks a lot.

25th May 2006, 19:48
I believe you are looking for the Observer pattern (http://en.wikipedia.org/wiki/Observer_pattern).

26th May 2006, 06:48
Thanks for the reply. I found one more link (http://www.scottcollins.net/articles/a-deeper-look-at-signals-and-slots.html) which was useful.