summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2024-01-31 10:30:55 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2024-02-23 19:11:04 +0100
commita730c426084f18d3890e5fc4462e535e72dbadc6 (patch)
tree8e3c21b69f59221f51b67786dc1be391b8fcee18 /tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt
parentf4eef861375744144e5ea0805b00748df2359c33 (diff)
JNI: Support QStringList as a parameter of native functions
Since we support QString and QList specializations, we should also support QStringList directly. That's a bit more involved as we need to specialize the code path for QString, which is not convertible to or from jobject. But once we have mapped the type to jstring it follows the implementation for lists of objects. We now need to generate temporary local references when converting a QString to a jstring, so manage a local frame. We do so explicitly in chunks of 100 local references. Change-Id: I7ae5cf7d0ba0099992c36f3677980c346526804b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt')
-rw-r--r--tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java b/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java
index 386c6aa5c8..48b456a4a3 100644
--- a/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java
+++ b/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java
@@ -283,6 +283,7 @@ public class QtJniObjectTestClass
native public int callbackWithDouble(double value);
native public int callbackWithJniArray(double[] value);
native public int callbackWithQList(double[] value);
+ native public int callbackWithStringList(String[] value);
public int callMeBackWithObject(QtJniObjectTestClass that)
{
@@ -326,4 +327,8 @@ public class QtJniObjectTestClass
{
return callbackWithQList(value);
}
+ public int callMeBackWithStringList(String[] value)
+ {
+ return callbackWithStringList(value);
+ }
}