summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/doc/src/objectmodel/signalsandslots.qdoc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
index 6d3064d217..0cbbef0502 100644
--- a/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
+++ b/src/corelib/doc/src/objectmodel/signalsandslots.qdoc
@@ -361,9 +361,11 @@
You can also connect to functors or C++11 lambdas:
\code
- connect(sender, &QObject::destroyed, [=](){ this->m_objects.remove(sender); });
+ connect(sender, &QObject::destroyed, context, [=](){ this->m_objects.remove(sender); });
\endcode
+ The lambda will be disconnected when the context is destroyed.
+
The other way to connect a signal to a slot is to use QObject::connect()
and the \c{SIGNAL} and \c{SLOT} macros.
The rule about whether to