summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@woboq.com>2014-01-14 13:54:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-17 11:25:31 +0100
commite59b28e08e7212415726fe9cd1b394e92607f061 (patch)
treec6811145b66fc48b5d5b31f1783c203a2f419448 /src
parent04b8af2739bb68b4c9648225c16cf6a515745fff (diff)
QObject: fix connection to function pointer with non-copyable references argument
For example, QObject is non copyable (its copy constructor is deleted or private via Q_DISABLE_COPY). It should still be allowed to pass a reference to a QObject as an argument to as signal (or slot). This fixes a compilation failure. Task-number: QTBUG-36119 Change-Id: I9bcf477e347d69fdae2543c99781b6421883be78 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qobjectdefs_impl.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h
index fb6601f21b..de6f65ab7d 100644
--- a/src/corelib/kernel/qobjectdefs_impl.h
+++ b/src/corelib/kernel/qobjectdefs_impl.h
@@ -567,9 +567,9 @@ namespace QtPrivate {
Q_STATIC_ASSERT(CheckCompatibleArguments<FunctionPointer<Signal>::Arguments, FunctionPointer<Slot>::Arguments>::value)
*/
template<typename A1, typename A2> struct AreArgumentsCompatible {
- static int test(A2);
+ static int test(const typename RemoveRef<A2>::Type&);
static char test(...);
- static A1 dummy();
+ static const typename RemoveRef<A1>::Type &dummy();
enum { value = sizeof(test(dummy())) == sizeof(int) };
};
template<typename A1, typename A2> struct AreArgumentsCompatible<A1, A2&> { enum { value = false }; };