qt5base-lts/tests/auto
Olivier Goffart 583c55b243 New QObject connection syntax
In addition to the old connection syntax, you can now connect using function pointers.

    connect(sender, &Sender::valueChanged,
            receiver, &Receiver::updateValue );

You can connect also to functor or C++11 lambdas

The connections are now type safe (no more problems with namespaces
or typedefs).  Implicit type conversion is also supported.

The new syntax forces us to change the meaning of signal form
protected to public, in order to be able to access the signal's
address everywhere

The way it works is by introducing new overload of QObject::connect
that take function pointer as parametter. Those new overload are template
function, that are implemented inline. The actual implementation is
in QObject::connectImpl which take a QObject::QSlotObject* as parametter
for the slot.  That slot object contains a virtual function which call
the slot which has to be implemented in the header as it depends on the
template parametter.  So the internals of QObjectPrivate::Connection
will store this QObjectSlot* in order to be able to make the call.

You can read a full description here:
http://developer.qt.nokia.com/wiki/New_Signal_Slot_Syntax

History of commits before it was imported on gerrit:
https://qt.gitorious.org/~ogoffart/qt/ogoffarts-qtbase/commits/qobject_connect_ptr

Thread on the mailing list:
http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000796.html
http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-September/001248.html
(The discussions on the mailing list were about trying to find a
solution that do not need making signals public, but no user friendly
solution was found)

Note: support for QueuedConnection, and the symetric QObject::disconnect is
added in another commit.
Qt::UniqueConnection is not supported yet in the new overload.

Change-Id: I67d08436b0720e7f2992be9f7e34770960fa58fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-11-25 01:12:14 +01:00
..
bic Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
compilerwarnings/data Remove uilib and QtUiTools from QtBase 2011-09-13 20:11:40 +02:00
corelib New QObject connection syntax 2011-11-25 01:12:14 +01:00
dbus Fix stack overwrite in QDBusDemarshaller 2011-11-23 19:14:12 +01:00
gui Fixed regression in tst_qscreen. 2011-11-23 22:23:55 +01:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
integrationtests Add a parents parameter to layoutChange signals. 2011-11-24 16:46:15 +01:00
network tst_qsslsocket: improve failure message 2011-11-21 04:55:02 +01:00
opengl Moved tests into gui/kernel/ and gui/qopengl/ 2011-11-04 20:48:19 +01:00
other Don't depend on moc to disable test functions. 2011-11-18 01:51:57 +01:00
sql SQLite support only one statement at a time 2011-11-23 08:36:14 +01:00
testlib Make usage of internal QVariant space. 2011-11-09 10:11:34 +01:00
tools Don't depend on moc to disable test functions. 2011-11-18 01:51:57 +01:00
v8 qtbase tests: Fix some warnings 2011-11-21 09:58:23 +01:00
widgets Added build system support for installing tests. 2011-11-23 00:13:46 +01:00
xml all remaining tests: eliminated usage of qttest_p4.prf 2011-10-25 08:42:23 +02:00
auto.pro Re-enable the opengl autotests on Mac OS X 2011-11-21 14:24:36 +01:00
network-settings.h Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
platformquirks.h Remove unused PlatformQuirks functions. 2011-11-05 02:31:07 +01:00
test.pl Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00