diff options
Diffstat (limited to 'src/corelib/kernel/qobjectdefs.h')
-rw-r--r-- | src/corelib/kernel/qobjectdefs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index d47c311c18..2013af1695 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -453,6 +453,8 @@ public: #ifdef Q_QDOC operator bool() const; #else + // still using the restricted bool trick here, in order to support + // code using copy-init (e.g. `bool ok = connect(...)`) typedef void *Connection::*RestrictedBool; operator RestrictedBool() const { return d_ptr && isConnected_helper() ? &Connection::d_ptr : nullptr; } #endif |