com.trolltech.qt.gui
Class QTreeModel

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.core.QObject
                  extended by com.trolltech.qt.core.QAbstractItemModel
                      extended by com.trolltech.qt.gui.QTreeModel
All Implemented Interfaces:
QtJambiInterface

public abstract class QTreeModel
extends QAbstractItemModel


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.core.QAbstractItemModel
columnsAboutToBeInserted, columnsAboutToBeRemoved, columnsInserted, columnsRemoved, dataChanged, headerDataChanged, layoutAboutToBeChanged, layoutChanged, modelAboutToBeReset, modelReset, rowsAboutToBeInserted, rowsAboutToBeRemoved, rowsInserted, rowsRemoved
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Method Summary
abstract  java.lang.Object child(java.lang.Object parent, int index)
          Returns the child specified by index, of the given node.
abstract  int childCount(java.lang.Object parent)
          Returns the given node's number of children, or 0 if the node is a leaf node.
 void childrenInserted(com.trolltech.qt.core.QModelIndex parent, int first, int last)
          Inserts last - first + 1 nodes into the given parent, before the node specified by first.
 void childrenRemoved(com.trolltech.qt.core.QModelIndex parent, int first, int last)
          Removes the nodes from first to last from the given parent, including the node specified by last.
 java.lang.Object data(java.lang.Object value, int role)
          Using the standard QTreeView class to view the content's of the model, the text is rendered using QTreeView's fonts.
 QIcon icon(java.lang.Object value)
          Reimplement this function to get graphical nodes.
 java.lang.Object indexToValue(com.trolltech.qt.core.QModelIndex index)
          Translates the given index to a value node and returns the node.
 void releaseChildren(com.trolltech.qt.core.QModelIndex index)
          Releases datastructures that are no longer needed, from the memory pool.
abstract  java.lang.String text(java.lang.Object value)
          Returns a string representation of the given value.
 com.trolltech.qt.core.QModelIndex valueToIndex(java.lang.Object object)
          Returns the model index for object.
 
Methods inherited from class com.trolltech.qt.core.QAbstractItemModel
beginInsertColumns, beginInsertRows, beginRemoveColumns, beginRemoveRows, buddy, canFetchMore, changePersistentIndex, changePersistentIndexList, columnCount, columnCount, createIndex, createIndex, createIndex, data, data, data, data, dropMimeData, endInsertColumns, endInsertRows, endRemoveColumns, endRemoveRows, fetchMore, flags, hasChildren, hasChildren, hasIndex, hasIndex, headerData, headerData, index, index, insertColumn, insertColumn, insertColumns, insertColumns, insertRow, insertRow, insertRows, insertRows, itemData, match, match, match, match, mimeData, mimeTypes, parent, persistentIndexList, removeColumn, removeColumn, removeColumns, removeColumns, removeRow, removeRow, removeRows, removeRows, reset, revert, rowCount, rowCount, setData, setData, setData, setData, setHeaderData, setHeaderData, setItemData, setSupportedDragActions, setSupportedDragActions, sibling, sort, sort, span, submit, supportedDragActions, supportedDropActions
 
Methods inherited from class com.trolltech.qt.core.QObject
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty
 
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 com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Method Detail

childrenInserted

public final void childrenInserted(com.trolltech.qt.core.QModelIndex parent,
                                   int first,
                                   int last)
Inserts last - first + 1 nodes into the given parent, before the node specified by first. Note that this function must be called when nodes have been inserted into the model.

See also:
beginInsertRows().


childrenRemoved

public final void childrenRemoved(com.trolltech.qt.core.QModelIndex parent,
                                  int first,
                                  int last)
Removes the nodes from first to last from the given parent, including the node specified by last. Note that this function must be called when nodes have been removed from the model.

See also:
beginDeleteRows().


indexToValue

public final java.lang.Object indexToValue(com.trolltech.qt.core.QModelIndex index)
Translates the given index to a value node and returns the node.


releaseChildren

public final void releaseChildren(com.trolltech.qt.core.QModelIndex index)
Releases datastructures that are no longer needed, from the memory pool.

Internally, the QTreeModel class caches the datastructures of nodes that have been expanded. Call the releaseChildren() function to release parts of this memory pool when they are no longer needed, for example when the view collapses a subtree.

Note that if the model is shared between multiple views, calling the model's releaseChildren() function affects all.


valueToIndex

public final com.trolltech.qt.core.QModelIndex valueToIndex(java.lang.Object object)
Returns the model index for object.


child

public abstract java.lang.Object child(java.lang.Object parent,
                                       int index)
Returns the child specified by index, of the given node.


childCount

public abstract int childCount(java.lang.Object parent)
Returns the given node's number of children, or 0 if the node is a leaf node.


data

public java.lang.Object data(java.lang.Object value,
                             int role)
Using the standard QTreeView class to view the content's of the model, the text is rendered using QTreeView's fonts. Reimplement this function to alter the view's rendering behavior.

The default implementation is calling text() and icon() function for the given value and role.


icon

public QIcon icon(java.lang.Object value)
Reimplement this function to get graphical nodes. The default implementation returns an empty icon.


text

public abstract java.lang.String text(java.lang.Object value)
Returns a string representation of the given value.