aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/platform/android
Commit message (Collapse)AuthorAgeFilesLines
* Docs: Fix a tag errorElias Toivola2025-11-051-1/+1
| | | | | | | Pick-to: 6.10 6.8 Task-number: QTBUG-140073 Change-Id: I54f1c2a09455bd9b232ff332b0725bb1c8c791c0 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: fix QtQuickView fields access levelAssam Boudjelthia2025-10-231-10/+10
| | | | | | | | | | | | Some fields under QtView and thus under QtQuickView are marked as protected which ends up shown in javadoc. These fiedls are internal and shouldn't be treated as public, so instead, make them private and provide package-private getters/setters for QtQuickView to access those fields internally. Task-number: QTBUG-141365 Change-Id: Ibefd262412a07b323ff9c40bcf57f5da21b53975 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Docs: Add brief to QtQuickViewContent class commentNicholas Bennett2025-09-081-2/+2
| | | | | | | | | @since seems to have been stoppping the comment entirely. Task-number: QTBUG-139688 Pick-to: 6.10.0 6.10 6.9 6.8 Change-Id: Iaf0e915a2304d1f25a7d87a82b94d06988d988e7 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Docs: Update existing and add missing links to online Java docsNicholas Bennett2025-09-081-364/+0
| | | | | | | | | | | | | | | | -Updated QtQuickView and QtQuickViewContent links to new pages. -Added links to QtQmlStatus Enum and QtQmlStatusChangeListener interface classes. -Removed the qdoc QtQuickView file. -Updated links in examples and the main Qt Quick for Android page. Task-number: QTBUG-127747 Fixes: QTBUG-138917 Fixes: QTBUG-123106 Fixes: QTBUG-135474 Pick-to: 6.10 6.10.0 6.9 6.8 Change-Id: I61a64c8637c222290e4c630d75d579f6bb23886c Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QQ4A: Allow QML functions to be called from JavaPetri Virkkunen2025-09-014-0/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds an API to QtQuickView and QtQuickViewContent which allows users to call QML functions, with the following limitations: * The function parameters must have type information * The function parameters must be supported types: real, double, int, boolean or string. * The function cannot return a value In the case of functions in QtQuickViewContent descendant classes, these limitations are enforced by the code generation in androiddeployqt. To continue the journey of a function call from Java to QML, this commit provides a JNI function which takes the view memory address, the function name and a list of parameters, which may be empty. When called, the JNI functions will look for a function with the given name and parameter count, and if found, will convert the data from JNI types into the expected QML types. After converting the data, the data and QMetaMethod are passed to QMetaMethodInvoker::invokeImpl which actually invokes the QML function. Task-number: QTBUG-137112 Change-Id: I6617e3f5e1ebfcec7e44887d4e01b5137245ac0d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add braces to m_hasQueuedStatus checkAhmed El Khazari2025-08-111-1/+2
| | | | | | | | | | | | | Added braces to the m_hasQueuedStatus check for consistency and to prevent potential errors if more statements are added later. No functional changes. Amends 76bb559e5fbf2dfaf017f8b4a3435938b4d5f4fa Pick-to: 6.10 6.9 6.9.2 Change-Id: Ic465f41cf08aed0f3f6222786f8fa13f8657d385 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: fix broken link under QtQuickView pageAssam Boudjelthia2025-08-081-1/+1
| | | | | | | | Amends e0791e838daeb0dc99a3f28270bbfda3214a9fbf. Pick-to: 6.8 6.9 6.10 Change-Id: I8bf20c2cb01e1ff8e261fbb0c596a5b6b6c8aa68 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* QQ4A: Docs: Update connectSignalListener docs in QtQuickView/ContentPetri Virkkunen2025-08-082-7/+16
| | | | | | | | Update return value and behavior descriptions in QtQuickView/QtQuickViewContent::connectSignalListener functions. Change-Id: I566b5c7940c74daec6f20072d2db35bb66d3f86f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QQ4A: Enable signal connection queuing in QtQuickView and ContentPetri Virkkunen2025-08-082-26/+43
| | | | | | | | | | | | | | | | | | | | | Use SignalQueue, implemented in an earlier patch, in QtQuickView and QtQuickViewContent to handle connecting to QML signals before the QML is done loading, in these cases: * QtQuickView: If the underlying QAndroidQuickView object has not been created * Once the QAndroidQuickView is created and the view reference is set, we can send the queued connections to the C++ side safely. * QtQuickViewContent: If the Content has not been attached to a QtQuickView * Once the Content has been assigned a QtQuickView, we can send these queued connections to the QtQuickView safely. The QtQuickView may or may not queue these as well. Task-number: QTBUG-137057 Change-Id: Id84fb184d2d60a95f0ffb77896d0c553d7f52338 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QQ4A: Add QtSignalQueue class to manage queued signal connectionsPetri Virkkunen2025-08-082-0/+59
| | | | | | | | | | | | | | | This class will be used in both QtQuickView and QtQuickViewContent, to keep track of queued signal connections and eventually process them, connecting them to the QML view. This class also introduces an internal class to represent the data required to make a successful signal connection, to assist with storing the data. Task-number: QTBUG-137057 Change-Id: I798dbf0c0b377f2bf07874b17b83d493aa4905d9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QQ4A: QAndroidViewSignalManager: Move signal connection ID gen to JavaPetri Virkkunen2025-08-086-62/+85
| | | | | | | | | | | So that later patches can return valid values from the API when connecting to signals of QML views that have not been loaded, the Java API must be able to generate listener IDs. These calls can even happen before the Qt libraries are loaded. Task-number: QTBUG-137057 Change-Id: If2cafe8fd65841d2bcfc4a079939d81a279c7982 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QQ4A: Add possibility to register signals before QML is loadedPetri Virkkunen2025-08-084-28/+105
| | | | | | | | | | | | | | | | | | | | This commit adds a queue mechanism and API in QAndroidViewSignalManager that allows callers to add signal listeners before the QML view has been loaded. API Added to QAndroidViewSignalManager always returns true, but might still fail if a signal with the desired signalName does not exist. If using the QtQuickViewContent API, this should never happen, but with the QtQuickView API, this is a possibility with typos or signal names that are computed with some logic in code. Internally, QAndroidViewSignalManager listens to the QQuickView::statusChanged signal to detect when the QML view is done loading. Task-number: QTBUG-137057 Change-Id: I2ea95f096517f2b7f45a60f236923d42cb5cf1fe Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: QQ4A: Fix synchronization issue with statusChanged signalPetri Virkkunen2025-06-302-14/+21
| | | | | | | | | | | | | | | | | | | | | Do not allow Qt Event Loop to continue spinning until the QtQmlStatusChangeListener has been notified about the status change in QQuickView or 1000ms have passed, whichever comes first. This timing issue could cause signals to not be received by the user in cases where QML signals were fired too quickly after the QML view was done loading, especially if the Android UI thread was under high load. This was due to the fact that the QtQmlStatusChange event was queued on the Android UI thread, after which the Qt event loop was allowed to keep spinning, emitting signals and such. In cases where the Android UI thread was under load, processing the queued QtQmlStatusChanged event could take long enough to lose the earliest QML signals. This was detected on the CI Android emulators during signallistener tests. Fixes: QTBUG-137025 Change-Id: Ibf04b71a556a7e4a2b5b0338e6ac7876b0228ae1 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: QQ4A: Add support for multiple signal arguments in QMLPetri Virkkunen2025-06-306-201/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for QML signals with multiple arguments to be used in the QQ4A context. In the QtQuickView[Content] layer, this commit adds a new overload for the connectSignalListener API. This new overload takes a Class<?>[] parameter instead of the Class<T> parameter of the old API. To support this, the corresponding QtAndroidQuickViewEmbedding native function has been replaced with one that takes a jclass array as well. There is a new implementation for the old single-class-argument API that calls the new API, instead of reimplementing the logic in two places. Signal connection and disconnection logic has been moved to QAndroidViewSignalManager, which is called from the QtAndroidQuickViewEmbedding namespace native functions. In QAndroidViewSignalManager, the signal connection now happens by connecting to the qt_metacall QMetaObject function, which the class has overridden. In QAndroidViewSignalManager::qt_metacall, the signal is handled by detecting the type of signal and parsing the data sent by the signal, either by reading the property of the sender of the signal that the signal is linked to, or parsing the void* arguments passed into qt_metacall. Task-number: QTBUG-124489 Change-Id: I416bb266b3ffe5c947264d942b1afe3349bca2d7 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Docs: Add tutorial on using QtQuickViews in Android FragmentsNicholas Bennett2025-06-241-0/+4
| | | | | | | | | | | | | | -Added a tutorial page. -Added autogenerated table of topics at the bottom of Qt Quick For Android -page, added qq4a-extra-topics group name for this purpose. -Updated the Qt Quick For Android Class doc to mention the fragments tutorial. Task-number: QTBUG-137077 Pick-to: 6.10 6.9 6.8 Change-Id: Ia7470c90fae385fd38170b2786995a6816b97b10 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
* QQ4A: Fix crash when rapidly writing and reading QML propertiesPetri Virkkunen2025-06-221-3/+15
| | | | | | | | | QtQuickViewContent calls to QMetaProperty functionality from the Android thread was leading to SIGSEGV crashes Fixes: QTBUG-136235 Pick-to: 6.10 6.9 6.8 Change-Id: Ib1fcebf455b12eee6e7f17fea3235f50d156c60c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: QQ4A: Connect QCoreApplication to QQmlEngine::quit signalPetri Virkkunen2025-05-161-0/+3
| | | | | | | | | Primarily to allow QQ4A auto tests to exit safely, but also in case any user wishes to use the Qt.quit() QML functionality. Fixes: QTBUG-132512 Change-Id: Id1b2c7a661b6cc36bc32fdca6040f5ae32c22364 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Amend QtQuickView threading documentationAssam Boudjelthia2025-03-031-1/+4
| | | | | | | | | | Amends 5229520b35e7d1b36682d1417fc3805f65470cc5. Pick-to: 6.9 6.8 Task-number: QTBUG-132295 Change-Id: I18d58737655f635184c387c0b4b782d148457358 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Docs: Fix broken link to bug in Qt Quick View for Android Class APINicholas Bennett2025-02-201-1/+1
| | | | | | | | | | Added the missing \l Fixes: QTBUG-133745 Pick-to: 6.8 6.9 Change-Id: I4357e15ea54230a86501c338a26d6ffc7ce403cf Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: add note to QtQuickView docs about thread safetyAssam Boudjelthia2025-02-181-0/+2
| | | | | | | | | Mention that it's thread safe unless otherwise specified. Task-number: QTBUG-132295 Pick-to: 6.9 6.8 Change-Id: Ibdb7db9f8221464a8bb384b37c46b8672bf535ac Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
* Android: remove unused imports from QtQuickViewAssam Boudjelthia2025-01-211-2/+0
| | | | | Change-Id: I91e30823385f4cb7a4c2d80a96d99ef1b9c0bcb4 Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
* Fix link in QtQuickView documentationOlli Vuolteenaho2024-12-301-1/+1
| | | | | | | | I guess this one was missed in d37583094a73ca85151f07c4570db916424d7a94. Pick-to: 6.9 6.8 Change-Id: I79778d028c00a5b732f76a4775361fbb98e447bb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Avoid deprecation warning in qandroidquickviewembedding.cppLars Schmertmann2024-12-281-1/+1
| | | | | | | | | | | 106:33: warning: 'QString' is deprecated: Use fromUtf8, QStringLiteral, or QLatin1StringView [-Wdeprecated-declarations] 106 | qPrintable(propertyValue.className())); | ^ Pick-to: 6.9 6.8 Change-Id: If3dc5a80d49cbeb2ea02f42f7c7c836eb1211714 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Fix generic Class type argument warningSoheil Armin2024-12-091-3/+3
| | | | | | | | | | | | Specify generic type argument for Class parameter to remove compiler warning. Also this fixes a documentation link to #loadContent Pick-to: 6.8 Change-Id: I7befabab19a46cd7210fd45704285a72c68f4b8c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Android: add onStatusChanged() overload passing a QtQuickViewContentKonsta Alajärvi2024-12-023-12/+36
| | | | | | | | | | | | | | | | | Add new onStatusChanged() method to QtQmlStatusChangeListener interface which receives the QtQuickViewContent with it. This offers the users a way to identify which QtQuickViewContent sent the onStatusChanged event. This is useful if there are multiple QtQuickViewContents in the app. Change protected getLibraryName, getModuleName and getFilePath methods of QtQuickViewContent.java to public, as they are needed for user to extract information out of the QtQuickViewContent object received with the onStatusChanged. Fixes: QTBUG-127420 Change-Id: I1dea9af32670e32fbe5bac7b7bcd16dde2341032 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: fix Xdoclint:all errorsRami Potinkara2024-11-264-38/+38
| | | | | | | | | | | 51ccfc0b32f3d69340bf82de4e7624c9e27b35bd enabled Xdoclint:all. That caused errors in submodule depedency round. This patch fixes the errors. Fixes: QTBUG-131594 Change-Id: Ie7af71c6dfebb203dbe2c51a6e5204a9eb5f52bd Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add documentation for multiple QtQuickViews in one host appPetri Virkkunen2024-10-291-0/+33
| | | | | | | | | | Since this is now properly supported in 6.9 and 6.8.1+, we should make that clear. Pick-to: 6.8 Task-number: QTBUG-129792 Change-Id: Ib2b83bfc378ca3c6414853d718f2cc181052d9df Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Update QtQuickView documentation to use new APIPetri Virkkunen2024-10-171-7/+19
| | | | | | | | | | | We should no longer be encouraging readers to use the old, string-based constructor for QtQuickView. Changed the code examples in the QtQuickView API documentation to use the new style of constructing. Task-number: QTBUG-130112 Pick-to: 6.8 Change-Id: I162350d237ac73427dcb09ba6e78aa9a8e350755 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Revert "Docs: Android: Add known issue about multiple QtQuickView cleanup"Petri Virkkunen2024-10-151-7/+0
| | | | | | | | | | This reverts commit 3787a3e5e50e6383a661ba61a5432a880e425d94. Reason for revert: Issue has been fixed. Task-number: QTBUG-127422 Change-Id: I219e27e1665dd4aab30ce51088b9051397d4e164 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Docs: Add links to Android classes and examplesNicholas Bennett2024-10-011-1/+1
| | | | | | | | | | | | Added links to the Qt Quick Android Classes page for examples. Added links to the Android Java classes provided by Qt Core. Renamed QML in Android Studio Projects example as Qt Quick for Android-related. Rename filename using qml in Android. Pick-to: 6.8 6.8.0 Change-Id: I79f79971ea7d224545c939a906bb449bd2b886c5 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Docs: Add main.cpp app entry point information for QtQuickViewNicholas Bennett2024-09-241-0/+17
| | | | | | | | | | | Added the instruction that you cant use QActivityView and added the minimum main.cpp needed for the API to work. Fixes: QTBUG-129031 Pick-to: 6.8 6.8.0 Change-Id: I65c5a048ae7653aa6348f02e11f103cae10e779c Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io> Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Docs: Android: Add known issue about multiple QtQuickView cleanupPetri Virkkunen2024-09-241-0/+7
| | | | | | | Task-number: QTBUG-129221 Pick-to: 6.8 6.8.0 Change-Id: I08bbd63f3a5a32519b2d864f27ae5b66085d614b Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Docs: Add known issue to QtQuickView Class docsNicholas Bennett2024-09-241-0/+17
| | | | | | | | | | Added known issue section and linked to the QtQuick view doesn't handle recreation of Activity bug. Task-number: QTBUG-128925 Pick-to: 6.8 6.8.0 6.7 6.7.3 Change-Id: Ic02a5b1972782f6f8f8377296c17034452a8a438 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
* Docs: Remove QtQuickView Technical Preview StatusNicholas Bennett2024-09-242-3/+0
| | | | | | | | | | As discussed, this is no longer a tech preview in 6.8 Task-id: QTBUG-129225 Pick-to: 6.8 6.8.0 Change-Id: I79375c07be495212b985652aa444ce43a6842c4c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: Indicate signals with no params with QVariant<void*>Soheil Armin2024-09-101-1/+2
| | | | | | | | | | | | | | | | Previously we were sending an invalid QVariant if the emitted signal had no parameters. Distinction between an invalid QVariant and a artificial one was not possible in the Android type converter. In this change, we create a QVariant from void* that can be detected as "void" signal during type conversion. Fixes: QTBUG-128586 Pick-to: 6.8 Change-Id: I6371e25399801c8407e729bfa001ce61dd51dfbb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
* Android: move jar folder under android folderAssam Boudjelthia2024-08-308-0/+922
| | | | | | | | | | It seems to me that it fits much better there instead of directly under "quick" folder, and this follows other plugins and modules Android code structure. Pick-to: 6.8 Change-Id: I837e8cddaffabd239ca1dac966aaf6182e60afd3 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
* Android: Remove APIs that are being moved to qtcoreSoheil Armin2024-08-218-882/+4
| | | | | | | | | Pick-to: 6.8 Task-number: QTBUG-126976 Task-number: QTBUG-126977 Task-number: QTBUG-127082 Change-Id: I5ed4cccfb2c828cc6ecc3df78a397ec91aa32839 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix -no-pch Android buildOlli Vuolteenaho2024-07-152-1/+5
| | | | | | | | | Just including some missing includes. Pick-to: 6.8 Fixes: QTBUG-126782 Change-Id: I3c1be73aeb59b57d6f74f507f5e1164e68a693a5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* JNI: prepare for standard Java types getting declared in qtjnitypes.hVolker Hilsheimer2024-06-182-5/+8
| | | | | | | | | | | | | | Only declare the standard types locally if the QT_DECLARE_JNI_CLASS_STANDARD_TYPES preprocessor symbol is undefined. That allows us to merge the relevant changes in each submodule independently, without having to orchestrate the submodule update. Once all changes are in and the submodule update is through, remove the declarations entirely. Pick-to: 6.8 Change-Id: I88045c7d88a5f6f5ac00fe41389d63206ad854ad Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android QuickView embedding: use QJniArray to pass string listVolker Hilsheimer2024-06-152-12/+3
| | | | | | | | | | | | QJniArray<jstring> has "[Ljava/lang/String;" as the signature type, and is implicitly creatable from the Java String[] parameter we get from JNI. We can then get the QStringList using QJniArray::toContainer(). This removes the last usage of Q_DECLARE_JNI_TYPE in this repo. Pick-to: 6.8 Change-Id: I766e3eccc7fd7c9551f7c8303d99dbe44e6a8e06 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add auto tests for Java QtAbstractItemModelSoheil Armin2024-06-022-2/+4
| | | | | | | | | | This auto test will test the Java QtAbstractItemModel when extending it in Java and getting the proxy object in C++. Task-number: QTBUG-125605 Change-Id: Id508ac8b47f760fe8857ede4fda9b22c62cfd72d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add QtQmlComponent loading support to QtQuickViewSoheil Armin2024-05-312-22/+30
| | | | | | | | | | | | | | | | | | | | | | | | A QQmlComponent component implementation, can deliver app library name, module name, and the path to QML component to be loaded. It also wraps set/get/connect methods of QtQuickView with protected access. We can generate QQmlComponent concrete classes for selected components at build time. Generated implementations, will have typed set/get/connect methods, associated with properties and signals of the QML component. Alternatively, it's possible for the user to subclass QQmlComponent. We add a new ctors to QtQuickView that takes only the Context. Later, The user should instantiate and pass the QQmlComponent to loadComponent(). QtQuickView gets required lib,module and component from the implementation and loads the QML component by an internal new QQuickView instance. If the there is already a QQuickView instance available, it will be reused. Task-number: QTBUG-124846 Change-Id: Ic29beb1b3faecd9f2e70621ddcc286a1a7659cb5 Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add sibling method to Java QtAbstractItemModelSoheil Armin2024-05-292-1/+29
| | | | | | | Task-number: QTBUG-124803 Change-Id: Id6d6be44486fb93901133c20599e1d6f79da2d8a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
* Android: Add Java QtAbstractItemModel as a QAIM wrapperSoheil Armin2024-05-297-6/+734
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtAbstractItemModel is a Java wrapper of QAbstractItemModel. QtModelIndex is a Java wrapper of QModelIndex. QtAbstractItemModel is an abstract Java class that wraps commonly used public and protected functions of QAIM. A QAndroidItemModelProxy instance can be created as a proxy between the Java implementation and C++. The instance can be used as a *QAbstractItemModel, for instance to be passed as a QML property to the QQuickView instance, through QtQuickView. The implementation also has a private QtAbstractItemModelProxy Java class that exposes QAbstractItemModel* to the Java QtAbstractItemModel instance. QtModelIndex wraps a subset of QModelIndex APIs. As the ctor of QModelIndex is private, we use row + column + internalId to create new Java QtModelIndex instance when proxying from a QtAbstractItemModel using the internal QtAndroidItemModelProxy. When the proxying happens from *QAbstractItemModel to Java, we use row + column + parent, as QAIM::index() should be used instead of QAIM::createIndex(). This change also add required type conversions between C++ types and Java types. [ChangeLog][Android] Added new public Java classes, QtAbstractItemModel and QtModelIndex to wrap a subset of their C++ counterpart functionalities, through internal proxies. Task-number: QTBUG-124803 Change-Id: I2464d3d30592aeec8b678445c946e4d167dc4886 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Fix Java Boolean conversion to boolSoheil Armin2024-05-291-1/+1
| | | | | | | | | The java Boolean and its jni value type jboolean, has been defined as uint8_t in jni.h. We should explicitly convert it to bool type when creating a QVariant out of it. Change-Id: I93651a8a11026970d63f7a008dc42f50808a0050 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add missing Long type conversionSoheil Armin2024-05-292-0/+8
| | | | | | Fixes: QTBUG-125723 Change-Id: I6f4fc4323feec489dae8213572d976cbd2653ec6 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Move Java types and conversion functions to their own headerSoheil Armin2024-05-225-82/+129
| | | | | | Task-number: QTBUG-125291 Change-Id: Ia675c97c296fa1aad1a06b4c4de23b2f803ede7f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add QAndroidQuickView class that owns QAndroidViewSignalManagerSoheil Armin2024-05-223-12/+25
| | | | | | | | | | | | | | Previously QAndroidViewSignalManager was a direct child of the QQuickView. In JNI calls that we did not have a reference to the signal manager, we had to use findChild to get access to the instance of it. We add QAndroidQuickView as a QQuickView subclass that owns the QAndroidViewSignalManager instance. Task-number: QTBUG-124488 Change-Id: I02ad10756a4af1ac82f130f349e7c8b6f563c70c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Rename and split SignalHelper into new header and source filesSoheil Armin2024-05-224-152/+200
| | | | | | | | | | | SignalHelper renamed to QAndroidViewSignalManger SignalInfo nested struct renamed to ConnectionInfo And QAndroidViewSignalManger split into new header and source files. Task-number: QTBUG-124488 Change-Id: I77ab8bf995043993224a6c5cafce5ac57dca59d9 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Improve error handling and logging of QtQuickViewSoheil Armin2024-05-221-19/+21
| | | | | | | | | | | | | | | | We obtain pointers to the QQuickView and its root object in various functions of QtQuickView interals. The warning messages used to be scattered in these functions. 1- A functions has been added to get both QQuickView and root object instances in a tuple. 2- An static local message string has been added to be reused when outputting warnings 3- Retouched a few warning messages for consistency. Task-number: QTBUG-124522 Change-Id: I471ce390553e005380df360811ce15bff45c55ed Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>