From c1d41b42a18fc1566b2d5cfdae2a743f3e0fb8d9 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 21 Apr 2014 18:58:29 +0200 Subject: [PATCH] Document that the connection stay active when objects used in a lambda are destroyed Task-number: QTBUG-37472 Change-Id: I44a6d7f8bf6928cd99a05d1b00fe36313cb18ffa Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qobject.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 01bedb4a3a..ea02352d56 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -4433,6 +4433,8 @@ void qDeleteInEventHandler(QObject *o) \snippet code/src_corelib_kernel_qobject.cpp 46 The connection will automatically disconnect if the sender is destroyed. + However, you should take care that any objects used within the functor + are still alive when the signal is emitted. \note If the compiler does not support C++11 variadic templates, the number of arguments in the signal or slot are limited to 6, and the functor object @@ -4470,6 +4472,8 @@ void qDeleteInEventHandler(QObject *o) The connection will automatically disconnect if the sender or the context is destroyed. + However, you should take care that any objects used within the functor + are still alive when the signal is emitted. \note If the compiler does not support C++11 variadic templates, the number of arguments in the signal or slot are limited to 6, and the functor object