The PySide.QtGui.QProxyModel class provides support for processing data passed between another model and a view.
If you want to do filtering and sorting, see PySide.QtGui.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 PySide.QtGui.QAbstractItemView , PySide.QtGui.QProxyModel provides the PySide.QtGui.QProxyModel.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 PySide.QtCore.QAbstractItemModel
Parameters: | parent – PySide.QtCore.QObject |
---|
Constructs a proxy model with the given parent .
Parameters: | model – PySide.QtCore.QAbstractItemModel |
---|
Connect to all the signals emitted by given model .
Parameters: | model – PySide.QtCore.QAbstractItemModel |
---|
Disconnect from all the signals emitted by the given model .
Return type: | PySide.QtCore.QAbstractItemModel |
---|
Returns the model that contains the data that is available through the proxy model.
See also
Parameters: | model – PySide.QtCore.QAbstractItemModel |
---|
Sets the given model to be processed by the proxy model.
See also
Parameters: | source_index – PySide.QtCore.QModelIndex |
---|---|
Return type: | PySide.QtCore.QModelIndex |
Change the model pointer in the given source_index to point to the proxy model.
Parameters: | proxy_index – PySide.QtCore.QModelIndex |
---|---|
Return type: | PySide.QtCore.QModelIndex |
Change the model pointer in the given proxy_index to point to the source model.