summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjniobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add objectClass() and className() for QJniObjectAssam Boudjelthia2021-05-081-3/+33
| | | | | | | | This can be handy sometimes to avoid doing a env->GetObjectClass() call to get the jclass object. Change-Id: I015fe5ed73304338826e468e59778bcd3ceadc3b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Doc: Fix documentation warnings for QJni* classesTopi Reinio2021-05-051-39/+15
| | | | | | Pick-to: 6.1 Change-Id: Iab836fbdf649f1b3b60e88d32266361299ac4bb2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QJniObject: add callStatic[Object]Method overloads for jmethodIDIvan Solovev2021-05-031-0/+48
| | | | | | | | | | | | This patch extends the QJniObject::callStatic[Object]Method functions with the overload which accepts a jmethodID parameter. This can be convenient when the method id is already cached and you do not want to query the method by its name and signature. Task-number: QTBUG-92952 Change-Id: Ib0852a5a27da2a244ac63112784751ef9e32cfa5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix QJniObject templates implementationsAssam Boudjelthia2021-04-231-609/+100
| | | | | | | | | | | | | Define the template calls in the header to allow for better type handling and checking with constexpr and avoid overuse of macros. Depending on the type provided in the QJniObject's call, the signatures and the correct JNI function variant is used. If a type is not supported a static_assert throws a compiler error. Pick-to: 6.1 6.1.0 Change-Id: I8a4d3ce85e1ff76ef385633f2a68511fffd12e55 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Add documentation links for some JNI entitiesAssam Boudjelthia2021-04-161-1/+1
| | | | | | | | | | Add doc page link for: * AttachCurrentThread call. * Interface Function Table which describes JNIEnv. Pick-to: 6.1 6.1.0 Change-Id: I12b41429c40838e5133e58132930aede287e2e71 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Replace conversion operator by operator* in QJniEnvironmentAssam Boudjelthia2021-04-141-53/+53
| | | | | | | | | | | Since conversion operators do implicit conversion that might bring some potential issues while using the API, let's stick to having an operator* instead. Pick-to: 6.1 6.1.0 Change-Id: Ie7ad5537958944b8d1c11d69fbd30284b4b0344d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptionsAssam Boudjelthia2021-03-261-30/+30
| | | | | | | | | Address feedback from header view. Task-number: QTBUG-90211 Pick-to: 6.1 Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Simplify code, remove redundant conditionWang Yicun2021-03-051-3/+1
| | | | | | | | | | 'clazz || (!clazz && isCached)' is equivalent to 'clazz || isCached' Done-with: Tang Peng <tangpeng@uniontech.com> Pick-to: 6.1 Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Re-order includes in qjniobject.cppAssam Boudjelthia2021-02-221-1/+2
| | | | | | Pick-to: 6.1 Change-Id: I80acd829bfd0940d17170f2277e92bc9620ce929 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix docs misuse of escape character \Assam Boudjelthia2021-02-121-2/+2
| | | | | | | | | Use {} instead of \, this fix a badly generated block of text. Task-number: QTBUG-89632 Pick-to: 6.1 Change-Id: Ia4aad4c06285eb016a092f4340669fcbef1a6780 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Refactor duplicate code for clearing JNI exceptions before returningAssam Boudjelthia2021-02-111-80/+43
| | | | | | | | | | Add a private function to handle checking/clearing and deleting the local reference to jobject before returning a QJniObject. Task-number: QTBUG-89633 Pick-to: 6.1 Change-Id: I0ea28c8ba4da0bfc1e341c6b4c1f61fecfec87a6 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Documentation improvements to JNI APIAssam Boudjelthia2021-02-091-199/+257
| | | | | | | | | | | Amends 4e60681c879a54cf5b34862a30e27c492ed36363. Fixes: QTBUG-89632 Pick-to: 6.1 Change-Id: I7856e9b63eea5ba68a5472575016540ae656ec5f Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-271-0/+1872
As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>