qt5base-lts/tests/auto/corelib
Volker Hilsheimer 207aae5560 Simplify the creation of APIs that take a callback
Functions in Qt that take a callback need to support callables with or
without context objects, and member functions of an object. The
implementation of those overloads follows a pattern that ultimately
results in a QSlotObjectBase implementation being created and
passed to an implementation helper that takes care of the logic.

Factor that common pattern into a new helper template in QtPrivate
that returns a suitable QSlotObjectBase after checking that the
functor is compatible with the specified argument types.

Use that new helper template in the implementation of
QCoreApplication::requestPermission and QHostInfo::lookupHost.

The only disadvantage of centralizing this logic is that we cannot print
a more detailed error message indicating which argument types the
caller expects. However, that information is visible from the detailed
compiler errors anyway.

Change-Id: I24cf0b2442217857b96ffc4d2d6c997c4fae34e0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-04-26 22:06:31 +02:00
..
animation tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
global Short live q20::to_address! 2023-03-31 13:10:12 +01:00
io Move QZipReader/Writer from QtGui to QtCore 2023-04-26 12:01:05 +02:00
ipc tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
itemmodels Remove unused variables 2023-04-19 12:55:02 +02:00
kernel Simplify the creation of APIs that take a callback 2023-04-26 22:06:31 +02:00
mimetypes mimetypes/: port to qsizetype 2023-04-15 17:21:10 +02:00
platform tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
plugin QPluginLoader: don't instantiante multiple, identical instances 2023-04-05 00:29:16 -07:00
serialization Move QZipReader/Writer from QtGui to QtCore 2023-04-26 12:01:05 +02:00
text tst_qstringapisymmetry: silence a GCC warning 2023-04-08 13:21:24 +02:00
thread Rid of 'special case' markers 2023-04-13 18:30:58 +02:00
time QDate: use more constexpr vars instead of plain numbers 2023-04-22 20:04:30 +02:00
tools Remove unused variables 2023-04-19 12:55:02 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00