diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-10-29 02:57:57 +0100 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-11-07 01:59:51 +0800 |
commit | 93a6cd8bdfbb7a5bcb03c184cd1457e231a7939f (patch) | |
tree | 9f7d88d1a8729b7e141525be0dea000394cb81f8 /tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt | |
parent | e579cdceb8b54fea02c1ed9bfae8b5ef74902270 (diff) |
JNI: allow QString as a parameter to native methods
Expect a jstring on the va_list, and implicitly construct a QString from
that.
As a drive-by, allow native methods to take parameters by reference, and
move implementation details into a Detail namespace.
Add test coverage.
Change-Id: I31214938ccaea3f4d539b432e29d12434dd98377
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
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.java | 12 |
1 files changed, 12 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 b56447198f..ef1c6e2f88 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 @@ -275,6 +275,8 @@ public class QtJniObjectTestClass // -------------------------------------------------------------------------------------------- native public int callbackWithObject(QtJniObjectTestClass that); + native public int callbackWithObjectRef(QtJniObjectTestClass that); + native public int callbackWithString(String string); native public int callbackWithByte(byte value); native public int callbackWithBoolean(boolean value); native public int callbackWithInt(int value); @@ -285,6 +287,16 @@ public class QtJniObjectTestClass return callbackWithObject(that); } + public int callMeBackWithObjectRef(QtJniObjectTestClass that) + { + return callbackWithObjectRef(that); + } + + public int callMeBackWithString(String string) + { + return callbackWithString(string); + } + public int callMeBackWithByte(byte value) { return callbackWithByte(value); |