summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2023-09-16 11:41:20 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2023-09-20 00:05:39 +0200
commitece7b9430d35564186975dbaf20660ad83475748 (patch)
tree02ef07f7b284450d655523700811e466068bab18 /src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
parent92504813846f1ab4f4a5fb8ae7d948a6b6786c8f (diff)
JNI: Explicitly convert QtJniType instances to jobject for variadic arguments
When calling the (old and outdated) variadic argument overloads of callMethod (as opposed to the variadic template overloads), then we cannot pass complex types. That types declared via the Q_DECLARE_JNI_CLASS macro are trivial was an implementation detail that we shouldn't rely on as long as those types are not part of the public API. Cast explicitly to jobject so that we can make those types proper QJniObjects. Updating this code to use the new variadic template overloads is for a follow-up commit. Change-Id: Ia9d610c84de6f989ef957c23401b1cbc64d2d1ef Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp')
-rw-r--r--src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp b/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
index 25427d5ede..087aca943b 100644
--- a/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
+++ b/src/plugins/platforms/android/qandroidplatformdialoghelpers.cpp
@@ -19,7 +19,7 @@ static jclass g_messageDialogHelperClass = nullptr;
QAndroidPlatformMessageDialogHelper::QAndroidPlatformMessageDialogHelper()
: m_javaMessageDialog(g_messageDialogHelperClass, "(Landroid/app/Activity;)V",
- QtAndroid::activity())
+ static_cast<jobject>(QtAndroid::activity()))
{
}