Add QMetaMethod-based QObject::connect/disconnectNotify() API
authorKent Hansen <kent.hansen@nokia.com>
Fri, 20 Apr 2012 18:19:12 +0000 (20:19 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 30 Apr 2012 23:18:03 +0000 (01:18 +0200)
commit243ea09e4cc0908e28be44e3e6786ff8b73f74be
tree682dca749a478a3522e2313ea63564692f68ce1b
parent67245d1708696627a33afa0abc9f3c2b178b8d95
Add QMetaMethod-based QObject::connect/disconnectNotify() API

This API will fully replace the const char *-based connectNotify()
and disconnectNotify() in Qt5; the old functions will be REMOVED
before Qt 5.0 final.

The new implementation fixes the long-standing issue of
connectNotify() not being called when using the (internal)
index-based QMetaObject::connect() (e.g., from QML).

As with the old API, there are still two "unintuitive" behaviors
concerning disconnectNotify():
- disconnectNotify() is not called when the signal is disconnected
  using the QObject::disconnect(QMetaObject::Connection) overload.
- disconnectNotify() is not called when a receiver is destroyed
  (i.e., when a connection is implicitly removed).

The old versions of connectNotify() and disconnectNotify() are kept
for now, and they are still called. They will be removed once known
existing reimplementations (e.g., QtNetwork, QtDBus) have been
ported to the new API.

Change-Id: I8b4f007f3c6d89199c1ba04a3e23c8ca314e0896
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
src/corelib/doc/snippets/code/src_corelib_kernel_qobject.cpp
src/corelib/kernel/qmetaobject.cpp
src/corelib/kernel/qmetaobject_p.h
src/corelib/kernel/qobject.cpp
src/corelib/kernel/qobject.h
src/corelib/kernel/qobject_p.h
tests/auto/corelib/kernel/qobject/tst_qobject.cpp