diff options
author | Mårten Nordheim <marten.nordheim@qt.io> | 2023-07-11 09:57:23 +0200 |
---|---|---|
committer | Mårten Nordheim <marten.nordheim@qt.io> | 2023-08-24 07:45:05 +0200 |
commit | d8f7b887540d376b134a6f730ab4e68c0505f13c (patch) | |
tree | 16aaac8bc935cdb72c2c8cbf0392b0d42ea8bf86 | |
parent | 4ffb227c78420f91b9b8d8cb8ceba1d8fdf2ec6c (diff) |
Use the Callable helper in QCallableObject
They do the same work in determining the way to call the callable
but with slightly different preconditions.
Let's just re-use it.
Change-Id: Ie2ad54a49250ae8460d8f364f7ea01b651648034
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r-- | src/corelib/kernel/qobjectdefs_impl.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/kernel/qobjectdefs_impl.h b/src/corelib/kernel/qobjectdefs_impl.h index 72928f2235..e8dd262672 100644 --- a/src/corelib/kernel/qobjectdefs_impl.h +++ b/src/corelib/kernel/qobjectdefs_impl.h @@ -388,7 +388,11 @@ namespace QtPrivate { }; template<typename Func, typename... Args> - using Callable = typename CallableHelper<Func, Args...>::Type; + struct Callable : CallableHelper<Func, Args...>::Type + {}; + template<typename Func, typename... Args> + struct Callable<Func, List<Args...>> : CallableHelper<Func, Args...>::Type + {}; /* Wrapper around ComputeFunctorArgumentCount and CheckCompatibleArgument, @@ -531,10 +535,7 @@ namespace QtPrivate { { using FunctorValue = std::decay_t<Func>; using Storage = QtPrivate::CompactStorage<FunctorValue>; - using FuncType = std::conditional_t<std::is_member_function_pointer_v<FunctorValue>, - QtPrivate::FunctionPointer<FunctorValue>, - QtPrivate::Functor<FunctorValue, Args::size> - >; + using FuncType = Callable<Func, Args>; #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) Q_DECL_HIDDEN static void impl(int which, QSlotObjectBase *this_, QObject *r, void **a, bool *ret) |