|
|||||||||
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Constructor Summary | |
---|---|
QPersistentModelIndex()
This method is used internally by Qt Jambi. |
|
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. |
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()
Equivalent to data(Qt::DisplayRole). |
java.lang.Object |
data(int role)
Returns the data for the given role for the item referred to by the index. |
boolean |
equals(java.lang.Object other)
|
Qt.ItemFlags |
flags()
Returns the flags for the item referred to by the index. |
static QPersistentModelIndex |
fromNativePointer(QNativePointer nativePointer)
This function returns the QPersistentModelIndex instance pointed to by nativePointer |
long |
internalId()
This method is used internally by Qt Jambi. |
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)
This function returns a QNativePointer that is pointing to the specified 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. |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, 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 |
---|
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QPersistentModelIndex(QModelIndex index)
Creates a new QPersistentModelIndex that is a copy of the model index.
public QPersistentModelIndex(QPersistentModelIndex other)
Creates a new QPersistentModelIndex that is a copy of the other persistent model index.
public QPersistentModelIndex()
This method is used internally by Qt Jambi. Do not use it in your applications.
Method Detail |
---|
public final QModelIndex child(int row, int column)
Returns the child of the model index that is stored in the given row and column.
public final int column()
Returns the column this persistent model index refers to.
public final java.lang.Object data()
Equivalent to data(Qt::DisplayRole).
public final java.lang.Object data(int role)
Returns the data for the given role for the item referred to by the index.
public final Qt.ItemFlags flags()
Returns the flags for the item referred to by the index.
public final long internalId()
This method is used internally by Qt Jambi. Do not use it in your applications.
public final boolean isValid()
Returns true if this persistent model index is valid; otherwise returns false. A valid index belongs to a model, and has non-negative row and column numbers.
public final QAbstractItemModel model()
Returns the model that the index belongs to.
public final QModelIndex parent()
Returns the parent QModelIndex for this persistent index, or QModelIndex() if it has no parent.
public final int row()
Returns the row this persistent model index refers to.
public final 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.
public static QPersistentModelIndex fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.public static QNativePointer nativePointerArray(QPersistentModelIndex[] array)
array
- the array that the returned pointer will point to.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |