qt5base-lts/tests/auto/corelib/kernel/qobject
Olivier Goffart 029cc40c2a Allow connect to functors with less parameters than the signal
Before, the functor slot (or lambda expression) had to have the same amount
of arguments as the signal.
This shown to be a big problem to be able to connect to signals that had
a QPrivateSlot.

This implementation use the type of the operator() of the functor to
know how many arguments we have.
As a bonus, we also can check the arguments in a static assert.

The test comes from https://codereview.qt-project.org/#change,38703
But this patch also works without variadic template

If the compiler does not support decltype, we workaround the lack of it
by using another level of indirection.

Change-Id: I9850b43e8caf77356a2ec3f4c0b0ed532d96029e
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-11-06 18:43:14 +01:00
..
signalbug normalise signal/slot signatures [QtCore tests] 2012-10-22 03:21:01 +02:00
test Set the Qt API level to compatibility mode in all tests. 2012-08-01 15:37:46 +02:00
.gitignore QObject-test: Reorganize subprocess. 2011-12-14 07:07:09 +01:00
qobject.pro Fixed tst_qobject signalbug silently not compiled in -fast builds. 2012-02-23 09:06:44 +01:00
tst_qobject.cpp Allow connect to functors with less parameters than the signal 2012-11-06 18:43:14 +01:00