qt5base-lts/tests/auto/corelib/kernel/qjnienvironment
Volker Hilsheimer 601dbd6499 Add variadic template overloads for QJniObject/Environment methods
This allows the compiler to deduce the template arguments based on the
provided method parameters, which we can then pass to the methodSignature
and fieldSignature helpers to generate the signature string completely at
compile time.

Since we can't partially specialize template member functions, replace
the specializations for void methods with compile-time-if branches in
the general templates.

This variadic template now prevents implicit conversion from the
LiteralStorage types to const char* signatures, so catch the case where
such a type ends up in the parameter list.

Due to overload resolution rules for constructors, we need to explicitly
disable the constructor if any of the arguments is a string literal type,
as we have to keep the old C-style variadic function working for such
calls.

Add variations that use the variadic templates to the unit tests.

Change-Id: I8734664b38bae932369462330a9a03302254c33c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-13 18:13:49 +02:00
..
testdata/src/org/qtproject/qt/android/testdata Android: check if objectClass() is not null in registerNativeMethods() 2021-11-15 19:00:21 +00:00
CMakeLists.txt Fix registerNativeMethods for good 2021-02-11 14:03:50 +00:00
tst_qjnienvironment.cpp Add variadic template overloads for QJniObject/Environment methods 2022-05-13 18:13:49 +02:00