Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QtAbstractItemModel.java
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4package org.qtproject.qt.android;
5
6import java.util.HashMap;
7
74public abstract class QtAbstractItemModel
75{
98 public abstract int columnCount(QtModelIndex parent);
113 public abstract Object data(QtModelIndex index, int role);
125 public abstract QtModelIndex index(int row, int column, QtModelIndex parent);
156 public abstract int rowCount(QtModelIndex parent);
163 public native boolean canFetchMore(QtModelIndex parent);
170 public native void fetchMore(QtModelIndex parent);
180 public native boolean hasChildren(QtModelIndex parent);
190 public native boolean hasIndex(int row, int column, QtModelIndex parent);
199 public HashMap<Integer, String> roleNames()
200 {
201 return (HashMap<Integer, String>)jni_roleNames();
202 }
219 {
220 return (QtModelIndex)jni_sibling(row, column, parent);
221 }
231 protected final void beginInsertColumns(QtModelIndex parent, int first, int last)
232 {
233 jni_beginInsertColumns(parent, first, last);
234 }
243 protected final void beginInsertRows(QtModelIndex parent, int first, int last)
244 {
245 jni_beginInsertRows(parent, first, last);
246 }
279 protected final boolean beginMoveColumns(QtModelIndex sourceParent, int sourceFirst,
280 int sourceLast, QtModelIndex destinationParent,
281 int destinationChild)
282 {
283 return jni_beginMoveColumns(sourceParent, sourceFirst, sourceLast, destinationParent,
284 destinationChild);
285 }
320 protected final boolean beginMoveRows(QtModelIndex sourceParent, int sourceFirst,
321 int sourceLast, QtModelIndex destinationParent,
322 int destinationChild)
323 {
324 return jni_beginMoveRows(sourceParent, sourceFirst, sourceLast, destinationParent,
325 destinationChild);
326 }
340 protected final void beginRemoveColumns(QtModelIndex parent, int first, int last)
341 {
342 jni_beginRemoveColumns(parent, first, last);
343 }
356 protected final void beginRemoveRows(QtModelIndex parent, int first, int last)
357 {
358 jni_beginRemoveRows(parent, first, last);
359 }
382 protected final void beginResetModel() { jni_beginResetModel(); }
383
391 protected final QtModelIndex createIndex(int row, int column, long id)
392 {
393 return (QtModelIndex)jni_createIndex(row, column, id);
394 }
404 protected final void endInsertColumns() { jni_endInsertColumns(); }
413 protected final void endInsertRows() { jni_endInsertRows(); }
423 protected final void endMoveColumns() { jni_endMoveColumns(); }
433 protected final void endMoveRows() { jni_endMoveRows(); }
442 protected final void endRemoveColumns() { jni_endRemoveColumns(); }
452 protected final void endRemoveRows() { jni_endRemoveRows(); }
460 protected final void endResetModel() { jni_endResetModel(); }
461
462 private native void jni_beginInsertColumns(QtModelIndex parent, int first, int last);
463 private native void jni_beginInsertRows(QtModelIndex parent, int first, int last);
464 private native boolean jni_beginMoveColumns(QtModelIndex sourceParent, int sourceFirst,
465 int sourceLast, QtModelIndex destinationParent,
466 int destinationChild);
467 private native boolean jni_beginMoveRows(QtModelIndex sourceParent, int sourceFirst,
468 int sourceLast, QtModelIndex destinationParent,
469 int destinationChild);
470 private native void jni_beginRemoveColumns(QtModelIndex parent, int first, int last);
471 private native void jni_beginRemoveRows(QtModelIndex parent, int first, int last);
472 private native void jni_beginResetModel();
473 private native Object jni_createIndex(int row, int column, long id);
474 private native void jni_endInsertColumns();
475 private native void jni_endInsertRows();
476 private native void jni_endMoveColumns();
477 private native void jni_endMoveRows();
478 private native void jni_endRemoveColumns();
479 private native void jni_endRemoveRows();
480 private native void jni_endResetModel();
481 private native Object jni_roleNames();
482 private native Object jni_sibling(int row, int column, QtModelIndex parent);
483
484 private long m_nativeReference = 0;
485 private QtAbstractItemModel(long nativeReference) { m_nativeReference = nativeReference; }
486 private void detachFromNative() { m_nativeReference = 0; };
487 private long nativeReference() { return m_nativeReference; }
488 private void setNativeReference(long nativeReference) { m_nativeReference = nativeReference; }
489 private static boolean instanceOf(Object obj) { return (obj instanceof QtAbstractItemModel); }
490}
Definition main.cpp:8
final boolean beginMoveColumns(QtModelIndex sourceParent, int sourceFirst, int sourceLast, QtModelIndex destinationParent, int destinationChild)
abstract QtModelIndex parent(QtModelIndex index)
native boolean canFetchMore(QtModelIndex parent)
final void beginRemoveColumns(QtModelIndex parent, int first, int last)
abstract int rowCount(QtModelIndex parent)
native boolean hasIndex(int row, int column, QtModelIndex parent)
abstract Object data(QtModelIndex index, int role)
abstract QtModelIndex index(int row, int column, QtModelIndex parent)
native boolean hasChildren(QtModelIndex parent)
final QtModelIndex createIndex(int row, int column, long id)
final void beginRemoveRows(QtModelIndex parent, int first, int last)
native void fetchMore(QtModelIndex parent)
final void beginInsertColumns(QtModelIndex parent, int first, int last)
QtModelIndex sibling(int row, int column, QtModelIndex parent)
final boolean beginMoveRows(QtModelIndex sourceParent, int sourceFirst, int sourceLast, QtModelIndex destinationParent, int destinationChild)
final void beginInsertRows(QtModelIndex parent, int first, int last)
abstract int columnCount(QtModelIndex parent)
GLuint index
[2]
GLint first
GLenum GLenum GLsizei void GLsizei void * column
GLhandleARB obj
[2]
GLenum GLenum GLsizei void * row