JNI: convert to and from JNI types for callObjectMethod as well

While we can probably deprecate this function, with the change of
Q_DECLARE_JNI_CLASS'ed types to be QJniObjects we need to correctly
translate from e.g. jobject to QJniObject.

Amends 62cb5589b3.

Change-Id: Id3c23fc0724e2eff895029b694d418481abcb8e6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
bb10
Volker Hilsheimer 2023-10-11 13:35:16 +02:00
parent 322e2a2821
commit 872f7b0b4e
1 changed files with 3 additions and 1 deletions

View File

@ -148,7 +148,9 @@ public:
{
QtJniTypes::assertObjectType<Ret>();
constexpr auto signature = QtJniTypes::methodSignature<Ret, Args...>();
return callObjectMethod(methodName, signature.data(), std::forward<Args>(args)...);
LocalFrame<Args...> frame;
return frame.template convertFromJni<Ret>(callObjectMethod(methodName, signature,
frame.convertToJni(std::forward<Args>(args))...));
}
QJniObject callObjectMethod(const char *methodName, const char *signature, ...) const;