From 1e30be700a2602db2d439df2b70fc6b4727ac3fa Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 7 Nov 2015 12:32:42 +0100 Subject: [PATCH] qobject.h: remove hack that simulated decltype In order to know the type of the arguments of a functor with compilers not having decltype, it was simulated with an intermediary function. Now that decltype is mandatory, we can remove this hack Change-Id: I7eb283943abeeb4ef1c62358da89b0ede70b3ef5 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- src/corelib/kernel/qobject.h | 10 +--------- src/corelib/kernel/qobjectdefs_impl.h | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index 64c5b58fd4..118316484b 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -293,7 +293,7 @@ public: connect(const typename QtPrivate::FunctionPointer::Object *sender, Func1 signal, const QObject *context, Func2 slot, Qt::ConnectionType type = Qt::AutoConnection) { -#if defined (Q_COMPILER_DECLTYPE) && defined (Q_COMPILER_VARIADIC_TEMPLATES) +#if defined (Q_COMPILER_VARIADIC_TEMPLATES) typedef QtPrivate::FunctionPointer SignalType; const int FunctorArgumentCount = QtPrivate::ComputeFunctorArgumentCount::Value; @@ -313,15 +313,7 @@ public: Functors with overloaded or templated operator() are only supported if the compiler supports C++11 variadic templates */ -#ifndef Q_COMPILER_DECLTYPE //Workaround the lack of decltype using another function as indirection - return connect_functor(sender, signal, context, slot, &Func2::operator(), type); } - template - static inline QMetaObject::Connection connect_functor(const QObject *sender, Func1 signal, const QObject *context, - Func2 slot, Func2Operator, Qt::ConnectionType type) { - typedef QtPrivate::FunctionPointer SlotType ; -#else typedef QtPrivate::FunctionPointer SlotType ; -#endif typedef QtPrivate::FunctionPointer SignalType; typedef typename SlotType::ReturnType SlotReturnType; const int SlotArgumentCount = SlotType::ArgumentCount; diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index d5574a4dd1..dc445a426d 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -593,7 +593,7 @@ namespace QtPrivate { }; #endif -#if defined(Q_COMPILER_DECLTYPE) && defined(Q_COMPILER_VARIADIC_TEMPLATES) +#if defined(Q_COMPILER_VARIADIC_TEMPLATES) /* Find the maximum number of arguments a functor object can take and be still compatible with the arguments from the signal.