From 9c464c3bf4487379ce4f5a2db5eb2ec5c09c326f Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 1 Oct 2014 13:54:36 +0200 Subject: Update the signal and slots docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This lifts the documentation into a more recent context. One might argue that Qt is a little bit older too. Change-Id: I3e85f21bbad1179136629c2025e3499481fc8334 Task-number: QTBUG-16809 Reviewed-by: Leena Miettinen Reviewed-by: Topi Reiniƶ --- src/corelib/doc/src/objectmodel/signalsandslots.qdoc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/corelib/doc/src') diff --git a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc index 6dcf567c2e..f79e8a7dca 100644 --- a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc +++ b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc @@ -49,17 +49,14 @@ if a user clicks a \uicontrol{Close} button, we probably want the window's \l{QWidget::close()}{close()} function to be called. - Older toolkits achieve this kind of communication using + Other toolkits achieve this kind of communication using callbacks. A callback is a pointer to a function, so if you want a processing function to notify you about some event you pass a pointer to another function (the callback) to the processing function. The processing function then calls the callback when - appropriate. Callbacks have two fundamental flaws: Firstly, they - are not type-safe. We can never be certain that the processing - function will call the callback with the correct arguments. - Secondly, the callback is strongly coupled to the processing - function since the processing function must know which callback - to call. + appropriate. While successful frameworks using this method do exist, + callbacks can be unintuitive and may suffer from problems in ensuring + the type-correctness of callback arguments. \section1 Signals and Slots -- cgit v1.2.3