qt5base-lts/tests/auto/corelib/kernel/qobject
Volker Hilsheimer 3bf5b5f894 Use QSlotObject helpers in functor-cases of QMetaObject::invoke
Add helper that allows us to determine the argument list and return type
of a functor. This triggers a compile time error if the functor has
operator()() overloads (we only support zero-argument call operators, but
there might be const/noexcept variations). Use that helper to declare a
ZeroArgFunctor type which also declares a ReturnType and Arguments alias.

Add a Callable alias that now combines FunctionPointer and ZeroArgFunctor
into a single type that we can then use to merge the specializations of
QMetaObject::invokeMethod.

[ChangeLog][Potentially source-incompatible changes] Using a functor
with several operator() overloads in QMetaObject::invokeMethod now causes
a compile time error. Qt would previously ignore const and noexcept
overloads and always call the mutable version on a copy of the functor.

Change-Id: I3eb62c1128014b729575540deab615469290daeb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-05-05 21:45:56 +02:00
..
signalbug tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
.gitignore tst_qobject: Fix execution in debug&release shadow builds 2018-06-26 10:56:31 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
tst_qobject.cpp Use QSlotObject helpers in functor-cases of QMetaObject::invoke 2023-05-05 21:45:56 +02:00