com.trolltech.qt.gui
Class QProxyModel

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.QProxyModel
All Implemented Interfaces:
QtJambiInterface

public class QProxyModel
extends QAbstractItemModel

The QProxyModel class provides support for processing data passed between another model and a view. If you want to do filtering and sorting, see QSortFilterProxyModel.

Proxy models provide a standard model interface that can be used to manipulate the data retrieved through an underlying model. They can be used to perform operations such as sorting and filtering on the data obtained without changing the contents of the model.

Just as with subclasses of QAbstractItemView, QProxyModel provides the setModel() function that is used to specify the model to be acted on by the proxy. Views can be connected to either the underlying model or the proxy model with QAbstractItemView::setModel().

Since views rely on the information provided in model indexes to identify items of data from models, and to position these items in some visual representation, proxy models must create their own model indexes instead of supplying model indexes from their underlying models.

See also:
Model/View Programming, and 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
 
Constructor Summary
QProxyModel()
          Constructs a proxy model with the given parent.
QProxyModel(QObject parent)
          Constructs a proxy model with the given parent.
 
Method Summary
 java.util.List match(com.trolltech.qt.core.QModelIndex start, int role, java.lang.Object value, int hits, Qt.MatchFlags flags)
          Returns a list of model indexes that each contain the given value for the role specified.
 QAbstractItemModel model()
          Returns the model that contains the data that is available through the proxy model.
 void setModel(QAbstractItemModel model)
          Sets the given model to be processed by the proxy model.
 
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, 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
 

Constructor Detail

QProxyModel

public QProxyModel()
Constructs a proxy model with the given parent.


QProxyModel

public QProxyModel(QObject parent)
Constructs a proxy model with the given parent.

Method Detail

model

public final QAbstractItemModel model()
Returns the model that contains the data that is available through the proxy model.

See also:
setModel().


match

public java.util.List match(com.trolltech.qt.core.QModelIndex start,
                            int role,
                            java.lang.Object value,
                            int hits,
                            Qt.MatchFlags flags)
Returns a list of model indexes that each contain the given value for the role specified. The search begins at the start index and is performed according to the specified flags. The search continues until the number of matching data items equals hits, the last row is reached, or the search reaches start again, depending on whether MatchWrap is specified in flags.

See also:
QAbstractItemModel::match().

Overrides:
match in class QAbstractItemModel

setModel

public void setModel(QAbstractItemModel model)
Sets the given model to be processed by the proxy model.

See also:
model().