Question about extending QtAndroidExtras
Kálmán Viktor <[email protected]> Mon, 11 May 2020 19:38:52 +0200
| Newsgroups | gmane.comp.python.pyqt-pykde |
|---|---|
| Message-ID | <CA+sJfQwKxst4TVFRpFrL=6FoMJvsfz=kar42YXVG0-x5nLEhEg@mail.gmail.com> |
Hello!
I'm wondering if it would be possible to
extend QAndroidJniObject's callStaticMethod to a version that supports
passing in a single string argument and the return value is also a string.
I tried something like this locally, but both gave me JNI error when trying
to use them (the parameterless int return valued callStaticMethod works
fine but would it be good to pass in string, same for return value), but
I'm not really familiar with SIP so it was just guess work (also tried
changing int to QString but that also gave me an error)
static int callStaticMethod(const char *className, const char
*methodName, const char *signature, const char *parameter);
%MethodCode
sipRes = QAndroidJniObject::callStaticMethod<int>(a0, a1, a2, a3);
%End
static int callStaticMethod(const char *className, const char
*methodName, const char *parameter);
%MethodCode
sipRes = QAndroidJniObject::callStaticMethod<int>(a0, a1,
"(Ljava/lang/String;)I", a2);
%End