qt6-bb10/src
Volker Hilsheimer 80d4d55e25 JNI: add QJniArray class for easier working with arrays
Implements an iterator API and other standard member access functions
for sequential containers so that we can use ranged-for over an object
that is a jarray. Provides read-only access to individual elements
(which is mostly relevant for arrays of objects), or the entire data()
as a contiguous memory block (which is useful for arrays of primitive
types).

QJniObject call functions can return QJniArray<T> when the return type
is either explicitly QJniArray<T> or T[], or their Qt equivalent (e.g.
a jbyteArray can be taken or returned as a QByteArray). If the return
type is a jarray type, then a QJniObject is returned as before.

Arrays can be created from a Qt container through a constructor or the
generic fromData named constructor in the QJniArrayBase class, which
implements the generic logic.

Not documented as public API yet.

Added a compile-time test to verify that types are mapped correctly.
The function test coverage is added to the QJniObject auto-test, as
that already provides the Java test class with functions taking and
returning arrays of different types.

Change-Id: I0750fc4f4cce7314df3b10e122eafbcfd68297b6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-10-16 18:43:16 +02:00
..
3rdparty Remove 'SecurityCritical' attribute for psl-data 2023-10-04 18:36:53 +00:00
android Android: Simplify Qt for Android hierarchy, less Java reflection! 2023-10-12 19:16:47 +03:00
assets Add XDG theme file for example icons 2023-06-26 17:32:10 +00:00
concurrent Doc: Fix warnings and linking issues 2023-10-09 17:24:07 +00:00
corelib JNI: add QJniArray class for easier working with arrays 2023-10-16 18:43:16 +02:00
dbus Doc: Add missing return type to QDBusReply::value 2023-10-13 18:00:37 +02:00
entrypoint src: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-10 23:36:51 +01:00
gui Sync also the profile env.var between Quick and RHI backingstores 2023-10-16 18:43:16 +02:00
network QNonContigByteDeviceThreadForwardImpl: NSDMI 2023-10-13 11:58:51 +02:00
opengl Include what you need: <QPointer> 2023-10-12 21:38:54 +02:00
openglwidgets QOpenGLWidget: Call glClear in the default paintGL implementation 2023-09-04 11:46:29 +02:00
platformsupport Include what you need: <QPointer> 2023-10-12 21:38:54 +02:00
plugins QNetworkInfo[NetworkManager]: Avoid creating temporary QStrings 2023-10-16 17:41:21 +02:00
printsupport Include what you need: <QPointer> 2023-10-12 21:38:54 +02:00
sql QSqlDatabase: check if QCoreApplication::instance() exists 2023-10-12 06:16:46 +02:00
testlib Doc: Fix warnings and linking issues 2023-10-09 17:24:07 +00:00
tools windeployqt: Don't copy files from unneeded QML modules 2023-10-10 13:19:34 +02:00
widgets Fusion style/QProgressBar: fix High-DPI issues 2023-10-13 18:23:44 +02:00
xml Doc: Fix warnings and linking issues 2023-10-09 17:24:07 +00:00
CMakeLists.txt Add Qt icon library for examples 2023-04-22 18:14:38 +03:00