|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QPersistentModelIndex
public class QPersistentModelIndex
The QPersistentModelIndex
class is used to locate data in a data model. A QPersistentModelIndex
is a model index that can be stored by an application, and later used to access information in a model. Unlike the QModelIndex class, it is safe to store a QPersistentModelIndex
since the model will ensure that references to items will continue to be valid as long as they can be accessed by the model.
It is good practice to check that persistent model indexes are valid before using them.
QAbstractItemModel
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Constructor Summary | |
---|---|
QPersistentModelIndex(QModelIndex index)
Creates a new QPersistentModelIndex that is a copy of the model index. |
|
QPersistentModelIndex(QPersistentModelIndex other)
Creates a new QPersistentModelIndex that is a copy of the other persistent model index. |
Method Summary | |
---|---|
QModelIndex |
child(int row,
int column)
Returns the child of the model index that is stored in the given row and column. |
QPersistentModelIndex |
clone()
This method is reimplemented for internal reasons |
int |
column()
Returns the column this persistent model index refers to. |
int |
compareTo(java.lang.Object other)
Compares this object with the specified object for order. |
java.lang.Object |
data()
Returns the data for the given role for the item referred to by the index. |
java.lang.Object |
data(int role)
Returns the data for the given role for the item referred to by the index. |
Qt.ItemFlags |
flags()
Returns the flags for the item referred to by the index. |
static QPersistentModelIndex |
fromNativePointer(QNativePointer nativePointer)
|
boolean |
isValid()
Returns true if this persistent model index is valid; otherwise returns false. |
QAbstractItemModel |
model()
Returns the model that the index belongs to. |
static QNativePointer |
nativePointerArray(QPersistentModelIndex[] array)
|
QModelIndex |
parent()
Returns the parent QModelIndex for this persistent index, or QModelIndex() if it has no parent. |
int |
row()
Returns the row this persistent model index refers to. |
QModelIndex |
sibling(int row,
int column)
Returns the sibling at row and column or an invalid QModelIndex if there is no sibling at this position. |
java.lang.String |
toString()
|
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QPersistentModelIndex(QModelIndex index)
QPersistentModelIndex
that is a copy of the model index.
public QPersistentModelIndex(QPersistentModelIndex other)
QPersistentModelIndex
that is a copy of the other persistent model index.
Method Detail |
---|
public final QModelIndex child(int row, int column)
parent()
, and sibling()
.
public final int column()
public final java.lang.Object data()
Qt::ItemDataRole
, and QAbstractItemModel::setData()
.
public final java.lang.Object data(int role)
Qt::ItemDataRole
, and QAbstractItemModel::setData()
.
public final Qt.ItemFlags flags()
public final boolean isValid()
model()
, row()
, and column()
.
public final QAbstractItemModel model()
public final QModelIndex parent()
child()
, sibling()
, and model()
.
public final int row()
public final QModelIndex sibling(int row, int column)
parent()
, and child()
.
public static QPersistentModelIndex fromNativePointer(QNativePointer nativePointer)
public static QNativePointer nativePointerArray(QPersistentModelIndex[] array)
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object
public QPersistentModelIndex clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |