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
org.qtproject.qt.android.QtAbstractListModel Class Referenceabstract
+ Inheritance diagram for org.qtproject.qt.android.QtAbstractListModel:
+ Collaboration diagram for org.qtproject.qt.android.QtAbstractListModel:

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)
 
- Public Member Functions inherited from org.qtproject.qt.android.QtAbstractItemModel
 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

- Protected Member Functions inherited from org.qtproject.qt.android.QtAbstractItemModel
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 ()
 

Detailed Description

Definition at line 8 of file QtAbstractListModel.java.

Constructor & Destructor Documentation

◆ QtAbstractListModel()

org.qtproject.qt.android.QtAbstractListModel.QtAbstractListModel ( )
inline

Definition at line 10 of file QtAbstractListModel.java.

Member Function Documentation

◆ columnCount()

final int org.qtproject.qt.android.QtAbstractListModel.columnCount ( QtModelIndex parent)
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.

Parameters
parentThe parent index.
Returns
The number of columns.
See also
#rowCount(QtModelIndex)

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().

+ Here is the call graph for this function:

◆ hasChildren()

final boolean org.qtproject.qt.android.QtAbstractListModel.hasChildren ( QtModelIndex parent)
inline

Returns true if the parent has any children; otherwise, returns false. Use rowCount() on the parent to get the number of children.

Parameters
parentThe parent index.
Returns
True if the parent has children, false otherwise.
See also
#parent(QtModelIndex index)
index(int row, int column, QtModelIndex parent)

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().

+ Here is the call graph for this function:

◆ index()

QtModelIndex org.qtproject.qt.android.QtAbstractListModel.index ( int row,
int column,
QtModelIndex parent )
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.

Parameters
rowThe row.
columnThe column.
parentThe parent index.
Returns
The index.
See also
#createIndex(int row, int column, long id)

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().

+ Here is the call graph for this function:

◆ parent()

final QtModelIndex org.qtproject.qt.android.QtAbstractListModel.parent ( QtModelIndex index)
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.

Parameters
indexThe index.
Returns
The parent index.
See also
#createIndex(int row, int column, long id)

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().

+ Here is the caller graph for this function:

◆ sibling()

QtModelIndex org.qtproject.qt.android.QtAbstractListModel.sibling ( int row,
int column,
QtModelIndex parent )
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.

Parameters
rowThe row.
columnThe column.
parentThe parent index.
Returns
The sibling index.

Reimplemented from org.qtproject.qt.android.QtAbstractItemModel.

Definition at line 26 of file QtAbstractListModel.java.


The documentation for this class was generated from the following file: