![]() |
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>.
|
Public Member Functions | |
QtAbstractListModel () | |
final int | columnCount (QtModelIndex parent) |
QtModelIndex | index (int row, int column, QtModelIndex parent) |
final QtModelIndex | parent (QtModelIndex index) |
final boolean | hasChildren (QtModelIndex parent) |
QtModelIndex | sibling (int row, int column, QtModelIndex parent) |
![]() | |
QtAbstractItemModel () | |
abstract Object | data (QtModelIndex index, int role) |
abstract int | rowCount (QtModelIndex parent) |
native boolean | canFetchMore (QtModelIndex parent) |
native void | fetchMore (QtModelIndex parent) |
native boolean | hasIndex (int row, int column, QtModelIndex parent) |
HashMap< Integer, String > | roleNames () |
Additional Inherited Members | |
![]() | |
final void | beginInsertColumns (QtModelIndex parent, int first, int last) |
final void | beginInsertRows (QtModelIndex parent, int first, int last) |
final boolean | beginMoveColumns (QtModelIndex sourceParent, int sourceFirst, int sourceLast, QtModelIndex destinationParent, int destinationChild) |
final boolean | beginMoveRows (QtModelIndex sourceParent, int sourceFirst, int sourceLast, QtModelIndex destinationParent, int destinationChild) |
final void | beginRemoveColumns (QtModelIndex parent, int first, int last) |
final void | beginRemoveRows (QtModelIndex parent, int first, int last) |
final void | beginResetModel () |
final QtModelIndex | createIndex (int row, int column, long id) |
final void | endInsertColumns () |
final void | endInsertRows () |
final void | endMoveColumns () |
final void | endMoveRows () |
final void | endRemoveColumns () |
final void | endRemoveRows () |
final void | endResetModel () |
Definition at line 8 of file QtAbstractListModel.java.
|
inline |
Definition at line 10 of file QtAbstractListModel.java.
|
inline |
Returns the number of columns for the children of the given parent. In most subclasses, the number of columns is independent of the parent.
For example: @Override int columnCount(const QtModelIndex parent) { return 3; }
When implementing a table-based model, columnCount() should return 0, when the parent is valid.
parent | The parent index. |
Reimplemented from org.qtproject.qt.android.QtAbstractItemModel.
Definition at line 12 of file QtAbstractListModel.java.
References org.qtproject.qt.android.QtModelIndex.isValid(), and org.qtproject.qt.android.QtAbstractListModel.parent().
|
inline |
Returns true if the parent has any children; otherwise, returns false. Use rowCount() on the parent to get the number of children.
parent | The parent index. |
Reimplemented from org.qtproject.qt.android.QtAbstractItemModel.
Definition at line 21 of file QtAbstractListModel.java.
References false, org.qtproject.qt.android.QtModelIndex.isValid(), org.qtproject.qt.android.QtAbstractListModel.parent(), and org.qtproject.qt.android.QtAbstractItemModel.rowCount().
|
inline |
Returns the index for the specified row and column for the supplied parent index. When re-implementing this function in a subclass, call createIndex() to generate model indexes that other components can use to refer to items in your model.
row | The row. |
column | The column. |
parent | The parent index. |
Reimplemented from org.qtproject.qt.android.QtAbstractItemModel.
Definition at line 14 of file QtAbstractListModel.java.
References org.qtproject.qt.android.QtAbstractItemModel.createIndex(), org.qtproject.qt.android.QtAbstractItemModel.hasIndex(), and org.qtproject.qt.android.QtAbstractListModel.parent().
|
inline |
Returns the parent of the model item with the given index. If the item has no parent, then an invalid QtModelIndex is returned.
A common convention used in models that expose tree data structures is that only items in the first column have children. For that case, when re-implementing this function in a subclass, the column of the returned QtModelIndex would be 0.
When re-implementing this function in a subclass, be careful to avoid calling QtModelIndex member functions, such as QtModelIndex::parent(), since indexes belonging to your model will call your implementation, leading to infinite recursion.
index | The index. |
Reimplemented from org.qtproject.qt.android.QtAbstractItemModel.
Definition at line 19 of file QtAbstractListModel.java.
Referenced by org.qtproject.qt.android.QtAbstractListModel.columnCount(), org.qtproject.qt.android.QtAbstractListModel.hasChildren(), and org.qtproject.qt.android.QtAbstractListModel.index().
|
inline |
Returns the sibling at row and column for the item at index or an invalid QModelIndex if there is no sibling at that location.
sibling() is just a convenience function that finds the item's parent and uses it to retrieve the index of the child item in the specified row and column.
This method can optionally be overridden to optimize a specific implementation.
row | The row. |
column | The column. |
parent | The parent index. |
Reimplemented from org.qtproject.qt.android.QtAbstractItemModel.
Definition at line 26 of file QtAbstractListModel.java.