The qt documentation is poor in QAndroidJniObject object. Could you possibly tell me what the difference between callStaticObjectMethod
and callStaticMethod
is and when should I use them?
If you have any working example, It would be appreciated if address them in you answers. (like Q notifier)
Thank you
Asked
Active
Viewed 1,288 times
2
-
`callStaticMethod` is used for basic types like int, float and `callStaticObjectMethod` for more complex objects like string – prajmus Feb 24 '15 at 14:20
-
@prajmus Thanks. Have you ever used callStaticObjectMethod yet? Should I use it when return type and input arguments are String? [Here](http://stackoverflow.com/questions/28695794/qt-does-not-compile-callstaticobjectmethod-it-says-no-matching-function-to-cal) I tried to use it in order to call a java static method but I failed to do that – a.toraby Feb 24 '15 at 14:27
1 Answers
1
As I've mentioned in a comment, the callStaticMethod
is used with primitive types (which are listed here). This function returns the type you requested (ex. jint
) not QAndroidJniObject
.
And callStaticObjectMethod
is used with methods returning an object type (which are listed here). It returns the QAndroidJniObject
.
You can find example code in Qt unit test files on their git repository

prajmus
- 3,171
- 3
- 31
- 41