4#include <QtQuick/private/qandroiditemmodelproxy_p.h>
5#include <QtQuick/private/qandroidmodelindexproxy_p.h>
6#include <QtQuick/private/qandroidtypeconverter_p.h>
8#include <QtCore/qjniarray.h>
16 if (!jModelIndex.isValid())
19 const QJniArray<jlong> jPrivateArray = jModelIndex.getField<jlong[]>(
"m_privateData");
20 const auto privateData = jPrivateArray.toContainer();
23 const jlong modelReference = privateData[3];
27 const jint
row = privateData[0];
28 const jint
column = privateData[1];
39 const JQtModelIndex
parent = jModelIndex.getField<JQtModelIndex>(
"m_parent");
49 return JQtModelIndex();
50 bool isModelProxy = qobject_cast<const QAndroidItemModelProxy *>(modelIndex.
model());
53 reinterpret_cast<jlong
>(modelIndex.
model()));
55 return JQtModelIndex(modelIndex.
row(), modelIndex.
column(),
57 reinterpret_cast<jlong
>(modelIndex.
model()));
95 return env.registerNativeMethods(
96 Traits<JQtModelIndex>::className(),
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the data in row and column with parent.
static jboolean isValid(JNIEnv *env, jobject object)
static JQtModelIndex jInstance(QModelIndex modelIndex)
static JQtModelIndex parent(JNIEnv *env, jobject object)
static QModelIndex qInstance(JQtModelIndex jModelIndex)
static jlong internalId(JNIEnv *env, jobject object)
static bool registerNatives(QJniEnvironment &env)
static jobject data(JNIEnv *env, jobject object, int role)
constexpr int row() const noexcept
Returns the row this model index refers to.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
constexpr const QAbstractItemModel * model() const noexcept
Returns a pointer to the model containing the item that this index refers to.
constexpr int column() const noexcept
Returns the column this model index refers to.
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
constexpr quintptr internalId() const noexcept
Returns a {quintptr} used by the model to associate the index with the internal data structure.
static Q_REQUIRED_RESULT jobject toJavaObject(const QVariant &var, JNIEnv *env)
Combined button and popup list for selecting options.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
QSqlQueryModel * model
[16]