diff options
author | Andreas Hartmetz <andreas@ixgreen.de> | 2020-08-30 12:01:15 +0200 |
---|---|---|
committer | Andreas Hartmetz <andreas@ixgreen.de> | 2020-09-01 13:35:39 +0200 |
commit | 7406949858a282a029913d6fba5684dff5e51185 (patch) | |
tree | c781409ba3eee3b105e38b892aad42dfc4faaf86 /src/corelib/kernel | |
parent | 7451453154690cb3e7e3ed6eccc1da8b555650b9 (diff) |
Doc fix: disconnect with receiver also works for context objects
One could guess it by assuming that disconnecting for a destroyed
receiver and disconnect() with given receiver use the same
implementation, but without closely knowing the implementation a
reader of the documentation can't know for sure.
Also add a test to prove that what the new documentation says is
really true.
Also remove an unnecessary negation in the preceding sentence.
Change-Id: I9d24442bb1a4646b89f969bad1a4d0e1eafa7534
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 62bee3d90b..b749e3916c 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -5009,8 +5009,9 @@ bool QObject::disconnect(const QMetaObject::Connection &connection) any signal. If not, only the specified signal is disconnected. If \a receiver is \nullptr, it disconnects anything connected to \a - signal. If not, slots in objects other than \a receiver are not - disconnected. + signal. If not, only slots in the specified receiver are disconnected. + disconnect() with a non-null \a receiver also disconnects slot functions + that were connected with \a receiver as their context object. If \a method is \nullptr, it disconnects anything that is connected to \a receiver. If not, only slots named \a method will be disconnected, |