Android: Fix incorrect JNI call from QAndroidItemModelProxy::sibling()

The return type of the QtAbstractItemModel.sibling() method is
a QtModelIndex Java type.
The JNI call from QAndroidItemModelProxy::sibling() is using
<jobject> as return type of QJniObject::callMethod(). This will
result in a non-matching JVM function signature.

This change replaces jobject with JQtModelIndex as the QtJniType.

Pick-to: 6.8
Fixes: QTBUG-132841
Change-Id: If157858f1ed49e25c8fbdfb9bb5c1fc2b7052826
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 190c85b706ee80bc92d6419676dca0dbfa60587b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Soheil Armin 2025-01-16 11:26:36 +02:00 committed by Qt Cherry-pick Bot
parent 813ea954b3
commit bbcf5a4191

View File

@ -125,7 +125,7 @@ QModelIndex QAndroidItemModelProxy::sibling(int row, int column, const QModelInd
{
Q_ASSERT(jInstance.isValid());
const QMutexLocker<QRecursiveMutex> lock = getMutexLocker(this);
return QAndroidModelIndexProxy::qInstance(jInstance.callMethod<jobject>(
return QAndroidModelIndexProxy::qInstance(jInstance.callMethod<JQtModelIndex>(
"sibling", row, column, QAndroidModelIndexProxy::jInstance(parent)));
}